summaryrefslogtreecommitdiffstats
path: root/drivers/w1
diff options
context:
space:
mode:
authorDavid Fries <David@Fries.net>2014-11-10 20:19:37 -0600
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-11-26 19:09:01 -0800
commit4b97b27939dd9b9ddbd4058efc96d45bc7163601 (patch)
tree18a83e875711fb4ee38a413197d0766f241df178 /drivers/w1
parenta30cfa475d1a26c18f1998ba1e034a4e2ab4c7a8 (diff)
downloadop-kernel-dev-4b97b27939dd9b9ddbd4058efc96d45bc7163601.zip
op-kernel-dev-4b97b27939dd9b9ddbd4058efc96d45bc7163601.tar.gz
w1: avoid potential u16 overflow
Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Evgeniy Polyakov <zbr@ioremap.net> Signed-off-by: David Fries <David@Fries.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/w1')
-rw-r--r--drivers/w1/w1_netlink.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/w1/w1_netlink.c b/drivers/w1/w1_netlink.c
index dd96562..881597a 100644
--- a/drivers/w1/w1_netlink.c
+++ b/drivers/w1/w1_netlink.c
@@ -598,7 +598,7 @@ static void w1_cn_callback(struct cn_msg *cn, struct netlink_skb_parms *nsp)
msg = (struct w1_netlink_msg *)(cn + 1);
if (node_count) {
int size;
- u16 reply_size = sizeof(*cn) + cn->len + slave_len;
+ int reply_size = sizeof(*cn) + cn->len + slave_len;
if (cn->flags & W1_CN_BUNDLE) {
/* bundling duplicats some of the messages */
reply_size += 2 * cmd_count * (sizeof(struct cn_msg) +
OpenPOWER on IntegriCloud