mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-19 22:07:49 +07:00
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: 658f24f452
("usb: usbtmc: Add ioctl for generic requests on control")
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
4d2a863fe9
commit
100f2cdead
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user