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
1 changed files with 1 additions and 0 deletions

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