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: Free memory allocated by memdup_user()
Browse files Browse the repository at this point in the history
Commit 3b74c73 switched over to memdup_user()
in ep_write() function and removed kfree (kbuf).
memdup_user() function allocates memory which is never freed.

Fixes: 3b74c73 (usb: gadget: inode: switch over to memdup_user())
Cc: <[email protected]> # v3.15+
Signed-off-by: Mario Schuknecht <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
  • Loading branch information
Mario Schuknecht authored and Felipe Balbi committed Dec 22, 2014
1 parent 68693b8 commit b44be24
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 @@ -449,6 +449,7 @@ ep_write (struct file *fd, const char __user *buf, size_t len, loff_t *ptr)
data->name, len, (int) value);
free1:
mutex_unlock(&data->lock);
kfree (kbuf);
return value;
}

Expand Down

0 comments on commit b44be24

Please sign in to comment.