Commit 412c8232 authored by Christian Gromm's avatar Christian Gromm Committed by Greg Kroah-Hartman

Staging: most: fix doing DMA on stack

This patch fixes error "doing DMA on the stack" by using kzalloc
for buffer allocation.
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarChristian Gromm <christian.gromm@microchip.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 3f78f611
...@@ -45,6 +45,7 @@ ...@@ -45,6 +45,7 @@
#define USB_VENDOR_ID_SMSC 0x0424 /* VID: SMSC */ #define USB_VENDOR_ID_SMSC 0x0424 /* VID: SMSC */
#define USB_DEV_ID_BRDG 0xC001 /* PID: USB Bridge */ #define USB_DEV_ID_BRDG 0xC001 /* PID: USB Bridge */
#define USB_DEV_ID_INIC 0xCF18 /* PID: USB INIC */ #define USB_DEV_ID_INIC 0xCF18 /* PID: USB INIC */
#define HW_RESYNC 0x0000
/* DRCI Addresses */ /* DRCI Addresses */
#define DRCI_REG_NI_STATE 0x0100 #define DRCI_REG_NI_STATE 0x0100
#define DRCI_REG_PACKET_BW 0x0101 #define DRCI_REG_PACKET_BW 0x0101
...@@ -140,20 +141,29 @@ static void wq_netinfo(struct work_struct *wq_obj); ...@@ -140,20 +141,29 @@ static void wq_netinfo(struct work_struct *wq_obj);
* @dev: usb device * @dev: usb device
* *
*/ */
static inline void trigger_resync_vr(struct usb_device *dev) static void trigger_resync_vr(struct usb_device *dev)
{ {
int data = 0; int retval;
u8 request_type = USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_ENDPOINT;
if (0 > usb_control_msg(dev, int *data = kzalloc(sizeof(*data), GFP_KERNEL);
usb_sndctrlpipe(dev, 0),
0, if (!data)
USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_ENDPOINT, goto error;
0, *data = HW_RESYNC;
0, retval = usb_control_msg(dev,
&data, usb_sndctrlpipe(dev, 0),
0, 0,
5 * HZ)) request_type,
pr_info("Vendor request \"stall\" failed\n"); 0,
0,
data,
0,
5 * HZ);
kfree(data);
if (retval >= 0)
return;
error:
pr_info("Vendor request \"stall\" failed\n");
} }
/** /**
......
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