summaryrefslogtreecommitdiff
path: root/drivers/net/can/usb
diff options
context:
space:
mode:
authorStephane Grosjean <s.grosjean@peak-system.com>2014-11-28 16:08:48 +0300
committerLuis Henriques <luis.henriques@canonical.com>2015-01-15 13:43:35 +0300
commit4e885c6c06bd10f5a63f0d1e5299b6c65deb6297 (patch)
treeb4d00fee9d27fde7f08f8c1ba946056226be74e8 /drivers/net/can/usb
parentadc34d72815b141faa6f972acf345a985ed028fe (diff)
downloadlinux-4e885c6c06bd10f5a63f0d1e5299b6c65deb6297.tar.xz
can: peak_usb: fix memset() usage
commit dc50ddcd4c58a5a0226038307d6ef884bec9f8c2 upstream. This patchs fixes a misplaced call to memset() that fills the request buffer with 0. The problem was with sending PCAN_USBPRO_REQ_FCT requests, the content set by the caller was thus lost. With this patch, the memory area is zeroed only when requesting info from the device. Signed-off-by: Stephane Grosjean <s.grosjean@peak-system.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
Diffstat (limited to 'drivers/net/can/usb')
-rw-r--r--drivers/net/can/usb/peak_usb/pcan_usb_pro.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/net/can/usb/peak_usb/pcan_usb_pro.c b/drivers/net/can/usb/peak_usb/pcan_usb_pro.c
index 263dd921edc4..f7f796a2c50b 100644
--- a/drivers/net/can/usb/peak_usb/pcan_usb_pro.c
+++ b/drivers/net/can/usb/peak_usb/pcan_usb_pro.c
@@ -333,8 +333,6 @@ static int pcan_usb_pro_send_req(struct peak_usb_device *dev, int req_id,
if (!(dev->state & PCAN_USB_STATE_CONNECTED))
return 0;
- memset(req_addr, '\0', req_size);
-
req_type = USB_TYPE_VENDOR | USB_RECIP_OTHER;
switch (req_id) {
@@ -345,6 +343,7 @@ static int pcan_usb_pro_send_req(struct peak_usb_device *dev, int req_id,
default:
p = usb_rcvctrlpipe(dev->udev, 0);
req_type |= USB_DIR_IN;
+ memset(req_addr, '\0', req_size);
break;
}