Commit bda39e44 authored by Malcolm Priestley's avatar Malcolm Priestley Committed by Kleber Sacilotto de Souza

staging: vt6656: use off stack for in buffer USB transfers.

BugLink: http://bugs.launchpad.net/bugs/1692900

commit 05c0cf88 upstream.

Since 4.9 mandated USB buffers to be heap allocated. This causes
the driver to fail.

Create buffer for USB transfers.
Signed-off-by: default avatarMalcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarStefan Bader <stefan.bader@canonical.com>
Signed-off-by: default avatarThadeu Lima de Souza Cascardo <cascardo@canonical.com>
parent 49e0d857
......@@ -78,15 +78,28 @@ int vnt_control_in(struct vnt_private *priv, u8 request, u16 value,
u16 index, u16 length, u8 *buffer)
{
int status;
u8 *usb_buffer;
if (test_bit(DEVICE_FLAGS_DISCONNECTED, &priv->flags))
return STATUS_FAILURE;
mutex_lock(&priv->usb_lock);
usb_buffer = kmalloc(length, GFP_KERNEL);
if (!usb_buffer) {
mutex_unlock(&priv->usb_lock);
return -ENOMEM;
}
status = usb_control_msg(priv->usb,
usb_rcvctrlpipe(priv->usb, 0), request, 0xc0, value,
index, buffer, length, USB_CTL_WAIT);
usb_rcvctrlpipe(priv->usb, 0),
request, 0xc0, value,
index, usb_buffer, length, USB_CTL_WAIT);
if (status == length)
memcpy(buffer, usb_buffer, length);
kfree(usb_buffer);
mutex_unlock(&priv->usb_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment