Staging: gdm72xx: silence underflow warning in netlink_send()
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 22 Feb 2016 19:31:31 +0000 (22:31 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 5 Mar 2016 22:48:04 +0000 (14:48 -0800)
The value of "group" comes from "idx" in __gdm_wimax_event_send():

if (sscanf(e->dev->name, "wm%d", &idx) == 1)

Smatch marks sscanf values as user controlled.  It's supposed to be a
number in 0-30 range.  We cap the upper bound but allow negatives.  Fix
this by making it type u16 instead.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/gdm72xx/netlink_k.c
drivers/staging/gdm72xx/netlink_k.h

index 984ca40f2bd3146858bc53ea4001d558127c1f1a..533e921d07ca7f064d7d1c977a9a5767d3d87891 100644 (file)
@@ -114,7 +114,7 @@ void netlink_exit(struct sock *sock)
        netlink_kernel_release(sock);
 }
 
-int netlink_send(struct sock *sock, int group, u16 type, void *msg, int len)
+int netlink_send(struct sock *sock, u16 group, u16 type, void *msg, int len)
 {
        static u32 seq;
        struct sk_buff *skb = NULL;
index 1fe7198d539e3b8857037df42b83c953c09b6631..1914347af8d3aac53cbc5a28c7fb16e948ca4a65 100644 (file)
@@ -20,6 +20,6 @@
 struct sock *netlink_init(int unit, void (*cb)(struct net_device *dev, u16 type,
                                               void *msg, int len));
 void netlink_exit(struct sock *sock);
-int netlink_send(struct sock *sock, int group, u16 type, void *msg, int len);
+int netlink_send(struct sock *sock, u16 group, u16 type, void *msg, int len);
 
 #endif /* __GDM72XX_NETLINK_K_H__ */
This page took 0.028179 seconds and 5 git commands to generate.