Patch "staging: vt6656: use off stack for out buffer USB transfers." has been added to the 4.4-stable tree
Subsystems (2)
This is a note to let you know that I've just added the patch titled
staging: vt6656: use off stack for out buffer USB transfers.
to the 4.4-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
staging-vt6656-use-off-stack-for-out-buffer-usb-transfers.patch
and it can be found in the queue-4.4 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From
12ecd24ef93277e4e5feaf27b0b18f2d3828bc5eMon Sep 17 00:00:00 2001
From: Malcolm Priestley <[email protected]>
Date: Sat, 22 Apr 2017 11:14:57 +0100
Subject: staging: vt6656: use off stack for out buffer USB transfers.
From: Malcolm Priestley <[email protected]>
commit 12ecd24ef93277e4e5feaf27b0b18f2d3828bc5e upstream.
Since 4.9 mandated USB buffers be heap allocated this causes the driver to fail.
Since there is a wide range of buffer sizes use kmemdup to create allocated buffer.
--- drivers/staging/vt6656/usbpipe.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)
drivers/staging/vt6656/usbpipe.c +12 -2
@@ -50,15 +50,25 @@ int vnt_control_out(struct vnt_private * u16 index, u16 length, u8 *buffer) { int status = 0; +u8 *usb_buffer;if (test_bit (DEVICE_FLAGS_DISCONNECTED , &priv->flags))return STATUS_FAILURE ;mutex_lock (&priv->usb_lock); + usb_buffer =kmemdup (buffer, length,GFP_KERNEL ); +if (!usb_buffer) { +mutex_unlock (&priv->usb_lock); +return -ENOMEM ; + } + status =usb_control_msg (priv->usb, -usb_sndctrlpipe (priv->usb,0 ), request,0x40 , value, - index, buffer, length,USB_CTL_WAIT ); +usb_sndctrlpipe (priv->usb,0 ), + request,0x40 , value, + index, usb_buffer, length,USB_CTL_WAIT ); + +kfree (usb_buffer);mutex_unlock (&priv->usb_lock);
Patches currently in stable-queue which might be from [email protected] are
queue-4.4/staging-vt6656-use-off-stack-for-in-buffer-usb-transfers.patch queue-4.4/staging-vt6656-use-off-stack-for-out-buffer-usb-transfers.patch