summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2016-02-22 22:31:31 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-03-05 14:48:04 -0800
commit724dfc25f596668ad361ecd562f1a741114500aa (patch)
treee7563058a6d274b01a95df66510cc0aac478b98f
parentc688671d89785238d0da56ee7b0ba00adaa5e260 (diff)
Staging: gdm72xx: silence underflow warning in netlink_send()
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>
-rw-r--r--drivers/staging/gdm72xx/netlink_k.c2
-rw-r--r--drivers/staging/gdm72xx/netlink_k.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/gdm72xx/netlink_k.c b/drivers/staging/gdm72xx/netlink_k.c
index 984ca40f2bd3..533e921d07ca 100644
--- a/drivers/staging/gdm72xx/netlink_k.c
+++ b/drivers/staging/gdm72xx/netlink_k.c
@@ -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;
diff --git a/drivers/staging/gdm72xx/netlink_k.h b/drivers/staging/gdm72xx/netlink_k.h
index 1fe7198d539e..1914347af8d3 100644
--- a/drivers/staging/gdm72xx/netlink_k.h
+++ b/drivers/staging/gdm72xx/netlink_k.h
@@ -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__ */