usb: gadget: gadgetfs: Free memory allocated by memdup_user()

Commit 3b74c73f8d 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: <stable@vger.kernel.org> # v3.15+
Signed-off-by: Mario Schuknecht <mario.schuknecht@dresearch-fe.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
This commit is contained in:
Mario Schuknecht 2014-12-16 08:58:57 +01:00 committed by Felipe Balbi
parent 68693b8ea4
commit b44be2462d
1 changed files with 1 additions and 0 deletions

View File

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