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

Commit 42d6cfa0 authored by Dan Carpenter's avatar Dan Carpenter Committed by Felipe Balbi
Browse files

usb: gadget: gadgetfs: fix an oops in ep_write()



We try to free an ERR_PTR on this error path.

Fixes: b44be246 ('usb: gadget: gadgetfs: Free memory allocated by memdup_user()')
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent c818a94c
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -441,6 +441,7 @@ ep_write (struct file *fd, const char __user *buf, size_t len, loff_t *ptr)
	kbuf = memdup_user(buf, len);
	if (IS_ERR(kbuf)) {
		value = PTR_ERR(kbuf);
		kbuf = NULL;
		goto free1;
	}