diff options
author | Stephane Grosjean <s.grosjean@peak-system.com> | 2014-11-28 08:08:48 -0500 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2014-12-06 13:11:18 -0500 |
commit | dc50ddcd4c58a5a0226038307d6ef884bec9f8c2 (patch) | |
tree | 167b64ab65c8d20e118a2d6a11bc95ccd507c7cd /drivers/net/can | |
parent | f2a01517f2a1040a0b156f171a7cefd748f2fd03 (diff) |
can: peak_usb: fix memset() usage
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>
Cc: linux-stable <stable@vger.kernel.org>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'drivers/net/can')
-rw-r--r-- | drivers/net/can/usb/peak_usb/pcan_usb_pro.c | 3 |
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, | |||
333 | if (!(dev->state & PCAN_USB_STATE_CONNECTED)) | 333 | if (!(dev->state & PCAN_USB_STATE_CONNECTED)) |
334 | return 0; | 334 | return 0; |
335 | 335 | ||
336 | memset(req_addr, '\0', req_size); | ||
337 | |||
338 | req_type = USB_TYPE_VENDOR | USB_RECIP_OTHER; | 336 | req_type = USB_TYPE_VENDOR | USB_RECIP_OTHER; |
339 | 337 | ||
340 | switch (req_id) { | 338 | switch (req_id) { |
@@ -345,6 +343,7 @@ static int pcan_usb_pro_send_req(struct peak_usb_device *dev, int req_id, | |||
345 | default: | 343 | default: |
346 | p = usb_rcvctrlpipe(dev->udev, 0); | 344 | p = usb_rcvctrlpipe(dev->udev, 0); |
347 | req_type |= USB_DIR_IN; | 345 | req_type |= USB_DIR_IN; |
346 | memset(req_addr, '\0', req_size); | ||
348 | break; | 347 | break; |
349 | } | 348 | } |
350 | 349 | ||