From: Jes Sorensen Date: Sat, 26 Apr 2014 16:54:51 +0000 (+0200) Subject: staging: rtl8723au: collect_bss_info23a(): Eliminate smatch warning X-Git-Tag: next-20140428~14^2~105 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=79a76349d59ab9cba7a9ea0abadbdac42bfee1b2;p=karo-tx-linux.git staging: rtl8723au: collect_bss_info23a(): Eliminate smatch warning Make length an unsigned int. This should avoid Smatch warning that 'length' can go negative. Reported-by: Dan Carpenter Signed-off-by: Jes Sorensen Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c index 21d112093fe1..e49170b3bb7a 100644 --- a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c @@ -4469,18 +4469,18 @@ u8 collect_bss_info23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame, struct wlan_bssid_ex *bssid) { - int i, length; + int i; const u8 *p; struct sk_buff *skb = precv_frame->pkt; struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *) skb->data; - int packet_len = skb->len; + unsigned int length; u8 ie_offset; struct registry_priv *pregistrypriv = &padapter->registrypriv; struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info; u16 capab_info; - length = packet_len - sizeof(struct ieee80211_hdr_3addr); + length = skb->len - sizeof(struct ieee80211_hdr_3addr); if (length > MAX_IE_SZ) { /* DBG_8723A("IE too long for survey event\n"); */