Commit 7042e8f2 authored by Wei Yongjun's avatar Wei Yongjun Committed by Felipe Balbi

usb: gadget: Fix return value check in ep_write()

In case of error, the function memdup_user() returns ERR_PTR()
and never returns NULL. The NULL test in the return value check
should be replaced with IS_ERR().
Signed-off-by: default avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 788b0bc4
......@@ -440,7 +440,7 @@ ep_write (struct file *fd, const char __user *buf, size_t len, loff_t *ptr)
value = -ENOMEM;
kbuf = memdup_user(buf, len);
if (!kbuf) {
if (IS_ERR(kbuf)) {
value = PTR_ERR(kbuf);
goto free1;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment