2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-20 11:13:58 +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:
Dan Carpenter 2015-01-06 13:19:21 +03:00 committed by Felipe Balbi
parent c818a94c77
commit 42d6cfa0ca

View File

@ -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;
}