mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
usb: gadget: gadgetfs: fix an oops in ep_write()
We try to free an ERR_PTR on this error path. Fixes: b44be2462dbe ('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…
x
Reference in New Issue
Block a user