From f844717c6a5b30ed605e6fbfcab685c6d2e58592 Mon Sep 17 00:00:00 2001 From: Jes Sorensen Date: Sat, 26 Apr 2014 18:54:55 +0200 Subject: [PATCH] staging: rtl8723au: rtw_cfg80211_inform_bss() fix Smatch warning Check the size of pnetwork->network.IELenght correctly to avoid Smatch warning. Reported-by: Dan Carpenter Signed-off-by: Jes Sorensen Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c index 5dbe3f43ab0e..74ac86a0333f 100644 --- a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c +++ b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c @@ -260,7 +260,7 @@ static int rtw_cfg80211_inform_bss(struct rtw_adapter *padapter, size_t notify_ielen; s32 notify_signal; u8 buf[MAX_BSSINFO_LEN], *pbuf; - size_t len, bssinf_len = 0; + size_t len; struct ieee80211_hdr *pwlanhdr; unsigned short *fctrl; @@ -270,11 +270,9 @@ static int rtw_cfg80211_inform_bss(struct rtw_adapter *padapter, /* DBG_8723A("%s\n", __func__); */ - bssinf_len = - pnetwork->network.IELength + sizeof(struct ieee80211_hdr_3addr); - if (bssinf_len > MAX_BSSINFO_LEN) { + if (pnetwork->network.IELength > MAX_IE_SZ) { DBG_8723A("%s IE Length too long > %d byte\n", __func__, - MAX_BSSINFO_LEN); + MAX_IE_SZ); goto exit; } -- 2.20.1