diff options
author | Yogesh Ashok Powar <yogeshp@marvell.com> | 2011-10-05 17:58:24 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-10-11 16:41:11 -0400 |
commit | 3d82de0fa584fbe73cf74a3bbc906c8710c523b8 (patch) | |
tree | 7cc59834bd6e7b298b4ceca53ca4c48c9c74c3e0 /drivers/net/wireless | |
parent | f49bbd2a45bf37d9fe202486712c89c214e33b5a (diff) |
mwifiex: fix smatch errors
drivers/net/wireless/mwifiex/main.c +828 mwifiex_remove_card(52)
error: potential null derefence 'priv'.
drivers/net/wireless/mwifiex/main.c +828 mwifiex_remove_card(52)
error: we previously assumed 'priv' could be null (see line 820)
drivers/net/wireless/mwifiex/txrx.c +90 mwifiex_process_tx(24)
error: potential null derefence 'local_tx_pd'.
drivers/net/wireless/mwifiex/sta_ioctl.c +766
mwifiex_rate_ioctl_set_rate_value(30)
error: buffer overflow 'rate' 14 <= 14
Cc: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/mwifiex/main.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/sta_ioctl.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/txrx.c | 3 |
3 files changed, 7 insertions, 2 deletions
diff --git a/drivers/net/wireless/mwifiex/main.c b/drivers/net/wireless/mwifiex/main.c index 848645118ad4..277ea84a05f5 100644 --- a/drivers/net/wireless/mwifiex/main.c +++ b/drivers/net/wireless/mwifiex/main.c | |||
@@ -825,6 +825,10 @@ int mwifiex_remove_card(struct mwifiex_adapter *adapter, struct semaphore *sem) | |||
825 | rtnl_unlock(); | 825 | rtnl_unlock(); |
826 | } | 826 | } |
827 | 827 | ||
828 | priv = adapter->priv[0]; | ||
829 | if (!priv) | ||
830 | goto exit_remove; | ||
831 | |||
828 | wiphy_unregister(priv->wdev->wiphy); | 832 | wiphy_unregister(priv->wdev->wiphy); |
829 | wiphy_free(priv->wdev->wiphy); | 833 | wiphy_free(priv->wdev->wiphy); |
830 | kfree(priv->wdev); | 834 | kfree(priv->wdev); |
diff --git a/drivers/net/wireless/mwifiex/sta_ioctl.c b/drivers/net/wireless/mwifiex/sta_ioctl.c index 520800b618e7..f20550a7c525 100644 --- a/drivers/net/wireless/mwifiex/sta_ioctl.c +++ b/drivers/net/wireless/mwifiex/sta_ioctl.c | |||
@@ -763,7 +763,7 @@ static int mwifiex_rate_ioctl_set_rate_value(struct mwifiex_private *priv, | |||
763 | if ((rate[i] & 0x7f) == (rate_cfg->rate & 0x7f)) | 763 | if ((rate[i] & 0x7f) == (rate_cfg->rate & 0x7f)) |
764 | break; | 764 | break; |
765 | } | 765 | } |
766 | if (!rate[i] || (i == MWIFIEX_SUPPORTED_RATES)) { | 766 | if ((i == MWIFIEX_SUPPORTED_RATES) || !rate[i]) { |
767 | dev_err(adapter->dev, "fixed data rate %#x is out " | 767 | dev_err(adapter->dev, "fixed data rate %#x is out " |
768 | "of range\n", rate_cfg->rate); | 768 | "of range\n", rate_cfg->rate); |
769 | return -1; | 769 | return -1; |
diff --git a/drivers/net/wireless/mwifiex/txrx.c b/drivers/net/wireless/mwifiex/txrx.c index 6190b2fa57a3..5d95c4b55a1f 100644 --- a/drivers/net/wireless/mwifiex/txrx.c +++ b/drivers/net/wireless/mwifiex/txrx.c | |||
@@ -87,7 +87,8 @@ int mwifiex_process_tx(struct mwifiex_private *priv, struct sk_buff *skb, | |||
87 | (adapter->pps_uapsd_mode) && | 87 | (adapter->pps_uapsd_mode) && |
88 | (adapter->tx_lock_flag)) { | 88 | (adapter->tx_lock_flag)) { |
89 | priv->adapter->tx_lock_flag = false; | 89 | priv->adapter->tx_lock_flag = false; |
90 | local_tx_pd->flags = 0; | 90 | if (local_tx_pd) |
91 | local_tx_pd->flags = 0; | ||
91 | } | 92 | } |
92 | dev_dbg(adapter->dev, "data: -EBUSY is returned\n"); | 93 | dev_dbg(adapter->dev, "data: -EBUSY is returned\n"); |
93 | break; | 94 | break; |