]> git.karo-electronics.de Git - linux-beck.git/commitdiff
w1: avoid potential u16 overflow
authorDavid Fries <David@Fries.net>
Tue, 11 Nov 2014 02:19:37 +0000 (20:19 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Nov 2014 03:09:01 +0000 (19:09 -0800)
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>
drivers/w1/w1_netlink.c

index dd96562372745ea11bd71d83901039423b24f403..881597a191b89c3ba4a1482f5a581efe00cdd668 100644 (file)
@@ -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) +