From: Oliver Hartkopp <socketcan@hartkopp.net>
To: Stephane Grosjean <s.grosjean@peak-system.com>,
linux-can@vger.kernel.org
Subject: Re: [PATCH] can/peak_usb: fix memset() usage
Date: Mon, 01 Dec 2014 20:37:12 +0100 [thread overview]
Message-ID: <547CC368.6080509@hartkopp.net> (raw)
In-Reply-To: <1417180128-28509-1-git-send-email-s.grosjean@peak-system.com>
Hello Stephane,
these two patches look good for stable.
I assume Marc will take them, when he has time for it.
What about the other patches?
Best regards,
Oliver
On 11/28/2014 02:08 PM, Stephane Grosjean wrote:
> 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>
> ---
> drivers/net/can/usb/peak_usb/pcan_usb_pro.c | 3 +--
> 1 file changed, 1 insertion(+), 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 263dd92..f7f796a 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;
> }
>
>
next prev parent reply other threads:[~2014-12-01 19:37 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-28 13:08 [PATCH] can/peak_usb: fix memset() usage Stephane Grosjean
2014-12-01 19:37 ` Oliver Hartkopp [this message]
2014-12-02 12:19 ` Marc Kleine-Budde
2014-12-02 12:35 ` Marc Kleine-Budde
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=547CC368.6080509@hartkopp.net \
--to=socketcan@hartkopp.net \
--cc=linux-can@vger.kernel.org \
--cc=s.grosjean@peak-system.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.