summaryrefslogtreecommitdiff
path: root/drivers/usb/class
diff options
context:
space:
mode:
authorGuido Kiener <guido.kiener@rohde-schwarz.com>2018-09-25 02:30:29 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-09-28 16:12:08 +0300
commit100f2cdeadffb3e63121d1d59a60a9882258c415 (patch)
treed63c1b075ce7ced0c363537d0bdf181357fd2877 /drivers/usb/class
parent4d2a863fe9b952d7147bd169d54062e71f343415 (diff)
downloadlinux-100f2cdeadffb3e63121d1d59a60a9882258c415.tar.xz
usb: usbtmc: Fix memory leak in usbtmc_ioctl_request
Kernel memory is allocated twice in new function usbtmc_ioctl_request and creates a memory leak. This fix removes the superfluous kmalloc(). Signed-off-by: Guido Kiener <guido.kiener@rohde-schwarz.com> Fixes: 658f24f4523e ("usb: usbtmc: Add ioctl for generic requests on control") Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/class')
-rw-r--r--drivers/usb/class/usbtmc.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c
index 0fcb81a1399b..dfbcf418dad7 100644
--- a/drivers/usb/class/usbtmc.c
+++ b/drivers/usb/class/usbtmc.c
@@ -1895,10 +1895,6 @@ static int usbtmc_ioctl_request(struct usbtmc_device_data *data,
if (res)
return -EFAULT;
- buffer = kmalloc(request.req.wLength, GFP_KERNEL);
- if (!buffer)
- return -ENOMEM;
-
if (request.req.wLength > USBTMC_BUFSIZE)
return -EMSGSIZE;