]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
USB: gadgetfs: Fix a potential memory leak in 'dev_config()'
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Tue, 21 Feb 2017 21:33:11 +0000 (22:33 +0100)
committerSasha Levin <alexander.levin@microsoft.com>
Wed, 17 Jan 2018 17:55:25 +0000 (12:55 -0500)
commit1c33170076ba1e16f6cb4021e3c76f485dea39cc
tree0530f9b6b9f7cecc1730b5f008a06807f3cb5b95
parent37177405c4afb7967cd091946be37ed2c94ff339
USB: gadgetfs: Fix a potential memory leak in 'dev_config()'

[ Upstream commit b6e7aeeaf235901c42ec35de4633c7c69501d303 ]

'kbuf' is allocated just a few lines above using 'memdup_user()'.
If the 'if (dev->buf)' test fails, this memory is never released.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
drivers/usb/gadget/legacy/inode.c