aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorArend van Spriel <arend@broadcom.com>2012-02-09 15:09:00 -0500
committerJohn W. Linville <linville@tuxdriver.com>2012-02-22 14:48:51 -0500
commit2315992c2a6f395dd3dfd4ba50a164d5f3ded84d (patch)
treebc70bc6f0d40fd3f75a4890eba733d0dcfe0fdd6 /drivers
parent137dabed34a13f90e068327b98329331367c9b46 (diff)
brcm80211: fmac: resolve smatch issues in brcmfmac code
This patch resolves the following smatch issues: wl_cfg80211.c +1377 brcmf_cfg80211_connect(65) warn: min_t truncates here '(sme->ssid_len)' (4294967295 vs 9223372036854775807) dhd_sdio.c +1275 brcmf_sdbrcm_rxglom(156) warn: min_t truncates here '(pfirst->len)' (2147483647 vs 4294967295) dhd_sdio.c +1457 brcmf_sdbrcm_rxglom(338) warn: min_t truncates here '(pfirst->len)' (2147483647 vs 4294967295) bcmsdh_sdmmc.c +300 brcmf_sdioh_request_buffer(10) warn: variable dereferenced before check 'pkt' (see line 295) Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c3
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c2
2 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c
index ac71adeece51..b698a76f8550 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c
@@ -294,13 +294,14 @@ int brcmf_sdioh_request_buffer(struct brcmf_sdio_dev *sdiodev,
294 struct sk_buff *pkt) 294 struct sk_buff *pkt)
295{ 295{
296 int status; 296 int status;
297 uint pkt_len = pkt->len; 297 uint pkt_len;
298 bool fifo = (fix_inc == SDIOH_DATA_FIX); 298 bool fifo = (fix_inc == SDIOH_DATA_FIX);
299 299
300 brcmf_dbg(TRACE, "Enter\n"); 300 brcmf_dbg(TRACE, "Enter\n");
301 301
302 if (pkt == NULL) 302 if (pkt == NULL)
303 return -EINVAL; 303 return -EINVAL;
304 pkt_len = pkt->len;
304 305
305 brcmf_pm_resume_wait(sdiodev, &sdiodev->request_buffer_wait); 306 brcmf_pm_resume_wait(sdiodev, &sdiodev->request_buffer_wait);
306 if (brcmf_pm_resume_error(sdiodev)) 307 if (brcmf_pm_resume_error(sdiodev))
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
index 74c95a597950..e95a883c77da 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
@@ -1376,7 +1376,7 @@ brcmf_cfg80211_connect(struct wiphy *wiphy, struct net_device *ndev,
1376 memset(&join_params, 0, sizeof(join_params)); 1376 memset(&join_params, 0, sizeof(join_params));
1377 join_params_size = sizeof(join_params.ssid_le); 1377 join_params_size = sizeof(join_params.ssid_le);
1378 1378
1379 ssid.SSID_len = min_t(u32, sizeof(ssid.SSID), sme->ssid_len); 1379 ssid.SSID_len = min_t(u32, sizeof(ssid.SSID), (u32)sme->ssid_len);
1380 memcpy(&join_params.ssid_le.SSID, sme->ssid, ssid.SSID_len); 1380 memcpy(&join_params.ssid_le.SSID, sme->ssid, ssid.SSID_len);
1381 memcpy(&ssid.SSID, sme->ssid, ssid.SSID_len); 1381 memcpy(&ssid.SSID, sme->ssid, ssid.SSID_len);
1382 join_params.ssid_le.SSID_len = cpu_to_le32(ssid.SSID_len); 1382 join_params.ssid_le.SSID_len = cpu_to_le32(ssid.SSID_len);