mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-04-30 11:09:51 -04:00
usb: gadget: gadgetfs: fix an oops in ep_write()
We try to free an ERR_PTR on this error path.
Fixes: b44be2462d ('usb: gadget: gadgetfs: Free memory allocated by memdup_user()')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
This commit is contained in:
committed by
Felipe Balbi
parent
c818a94c77
commit
42d6cfa0ca
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user