diff options
author | Monam Agarwal <monamagarwal123@gmail.com> | 2014-03-16 15:38:39 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-03-18 11:35:53 -0700 |
commit | a28bfd11ed7c02ac8c5a69495e614b40b01b8669 (patch) | |
tree | 5b7d78f33506d274db8fd188fe9a2a287b6bc1a8 /drivers/staging/gdm724x | |
parent | d2a5d36c1b62ec77107fad7e16c1fe7689072ee3 (diff) |
Staging: gdm724x: Fix unchecked sscanf values in gdm_lte.c
This patch fixes following checkpatch.pl warning:
WARNING: unchecked sscanf value in gdm_lte.c
Signed-off-by: Monam Agarwal <monamagarwal123@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/gdm724x')
-rw-r--r-- | drivers/staging/gdm724x/gdm_lte.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/staging/gdm724x/gdm_lte.c b/drivers/staging/gdm724x/gdm_lte.c index 0ddb65d54000..64c55b99fda4 100644 --- a/drivers/staging/gdm724x/gdm_lte.c +++ b/drivers/staging/gdm724x/gdm_lte.c @@ -468,7 +468,11 @@ static int gdm_lte_tx(struct sk_buff *skb, struct net_device *dev) if (!(nic_type & NIC_TYPE_F_DHCP)) nic_type &= NIC_TYPE_MASK; - sscanf(dev->name, "lte%d", &idx); + ret = sscanf(dev->name, "lte%d", &idx); + if (ret != 1) { + dev_kfree_skb(skb); + return -EINVAL; + } ret = nic->phy_dev->send_sdu_func(nic->phy_dev->priv_dev, data_buf, data_len, @@ -509,8 +513,11 @@ static int gdm_lte_event_send(struct net_device *dev, char *buf, int len) struct nic *nic = netdev_priv(dev); struct hci_packet *hci = (struct hci_packet *)buf; int idx; + int ret; - sscanf(dev->name, "lte%d", &idx); + ret = sscanf(dev->name, "lte%d", &idx); + if (ret != 1) + return -EINVAL; return netlink_send(lte_event.sock, idx, 0, buf, gdm_dev16_to_cpu( |