Skip to content
This repository has been archived by the owner on Dec 20, 2023. It is now read-only.

Commit

Permalink
usb: gadget: gadgetfs: fix an oops in ep_write()
Browse files Browse the repository at this point in the history
We try to free an ERR_PTR on this error path.

Fixes: b44be24 ('usb: gadget: gadgetfs: Free memory allocated by memdup_user()')
Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
  • Loading branch information
Dan Carpenter authored and Felipe Balbi committed Jan 10, 2015
1 parent c818a94 commit 42d6cfa
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/usb/gadget/legacy/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 42d6cfa

Please sign in to comment.