summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2015-01-06 13:19:21 +0300
committerFelipe Balbi <balbi@ti.com>2015-01-09 18:15:11 -0600
commit42d6cfa0caec4b68a7f17147fbf13a36e94a8bf2 (patch)
treee5fd239238dde73f8db45bd9602cfee27917210b /drivers
parentc818a94c77a9980709197c53368aa83451fd659f (diff)
downloadlinux-42d6cfa0caec4b68a7f17147fbf13a36e94a8bf2.tar.gz
linux-42d6cfa0caec4b68a7f17147fbf13a36e94a8bf2.tar.bz2
linux-42d6cfa0caec4b68a7f17147fbf13a36e94a8bf2.zip
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/gadget/legacy/inode.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/usb/gadget/legacy/inode.c b/drivers/usb/gadget/legacy/inode.c
index 08048613eed6..db49ec4c748e 100644
--- a/drivers/usb/gadget/legacy/inode.c
+++ b/drivers/usb/gadget/legacy/inode.c
@@ -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;
}