From: Dan Carpenter <dan.carpenter@oracle.com>
To: Wim Van Sebroeck <wim@iguana.be>, Guenter Roeck <linux@roeck-us.net>
Cc: linux-watchdog@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [patch] watchdog: pcwd_usb: overflow in usb_pcwd_send_command()
Date: Thu, 07 Nov 2013 07:40:28 +0000 [thread overview]
Message-ID: <20131107074028.GA21844@elgon.mountain> (raw)
We changed "buf" from being an array of 6 chars to being a pointer this
sizeof(buf) needs to be updated as well.
Fixes: 2ddb8089a7e5 ('watchdog: pcwd_usb: Use allocated buffer for usb_control_msg')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/watchdog/pcwd_usb.c b/drivers/watchdog/pcwd_usb.c
index 53598e8..7031b9b 100644
--- a/drivers/watchdog/pcwd_usb.c
+++ b/drivers/watchdog/pcwd_usb.c
@@ -258,7 +258,7 @@ static int usb_pcwd_send_command(struct usb_pcwd_private *usb_pcwd,
if (usb_control_msg(usb_pcwd->udev, usb_sndctrlpipe(usb_pcwd->udev, 0),
HID_REQ_SET_REPORT, HID_DT_REPORT,
- 0x0200, usb_pcwd->interface_number, buf, sizeof(buf),
+ 0x0200, usb_pcwd->interface_number, buf, 6,
USB_COMMAND_TIMEOUT) != sizeof(buf)) {
dbg("usb_pcwd_send_command: error in usb_control_msg for "
"cmd 0x%x 0x%x 0x%x\n", cmd, *msb, *lsb);
WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Wim Van Sebroeck <wim@iguana.be>, Guenter Roeck <linux@roeck-us.net>
Cc: linux-watchdog@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [patch] watchdog: pcwd_usb: overflow in usb_pcwd_send_command()
Date: Thu, 7 Nov 2013 10:40:28 +0300 [thread overview]
Message-ID: <20131107074028.GA21844@elgon.mountain> (raw)
We changed "buf" from being an array of 6 chars to being a pointer this
sizeof(buf) needs to be updated as well.
Fixes: 2ddb8089a7e5 ('watchdog: pcwd_usb: Use allocated buffer for usb_control_msg')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/watchdog/pcwd_usb.c b/drivers/watchdog/pcwd_usb.c
index 53598e8..7031b9b 100644
--- a/drivers/watchdog/pcwd_usb.c
+++ b/drivers/watchdog/pcwd_usb.c
@@ -258,7 +258,7 @@ static int usb_pcwd_send_command(struct usb_pcwd_private *usb_pcwd,
if (usb_control_msg(usb_pcwd->udev, usb_sndctrlpipe(usb_pcwd->udev, 0),
HID_REQ_SET_REPORT, HID_DT_REPORT,
- 0x0200, usb_pcwd->interface_number, buf, sizeof(buf),
+ 0x0200, usb_pcwd->interface_number, buf, 6,
USB_COMMAND_TIMEOUT) != sizeof(buf)) {
dbg("usb_pcwd_send_command: error in usb_control_msg for "
"cmd 0x%x 0x%x 0x%x\n", cmd, *msb, *lsb);
next reply other threads:[~2013-11-07 7:40 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-07 7:40 Dan Carpenter [this message]
2013-11-07 7:40 ` [patch] watchdog: pcwd_usb: overflow in usb_pcwd_send_command() Dan Carpenter
2013-11-07 7:47 ` Wim Van Sebroeck
2013-11-07 7:47 ` Wim Van Sebroeck
2013-11-07 14:27 ` Guenter Roeck
2013-11-07 14:27 ` Guenter Roeck
2013-11-07 14:33 ` Dan Carpenter
2013-11-07 14:33 ` Dan Carpenter
2013-11-08 9:24 ` [patch v2] " Dan Carpenter
2013-11-08 9:24 ` Dan Carpenter
2013-11-08 14:24 ` Guenter Roeck
2013-11-08 14:24 ` Guenter Roeck
2013-11-11 16:00 ` Guenter Roeck
2013-11-11 16:00 ` Guenter Roeck
2013-11-17 19:06 ` Wim Van Sebroeck
2013-11-17 19:06 ` Wim Van Sebroeck
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=20131107074028.GA21844@elgon.mountain \
--to=dan.carpenter@oracle.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=wim@iguana.be \
/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.