Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;
	}