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>
if (res)
return -EFAULT;
- buffer = kmalloc(request.req.wLength, GFP_KERNEL);
- if (!buffer)
- return -ENOMEM;
-
if (request.req.wLength > USBTMC_BUFSIZE)
return -EMSGSIZE;