mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-20 19:23:57 +08: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:
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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user