forked from Minki/linux
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 <dan.carpenter@oracle.com> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
0b682c9bb6
commit
79a76349d5
@ -4469,18 +4469,18 @@ u8 collect_bss_info23a(struct rtw_adapter *padapter,
|
|||||||
struct recv_frame *precv_frame,
|
struct recv_frame *precv_frame,
|
||||||
struct wlan_bssid_ex *bssid)
|
struct wlan_bssid_ex *bssid)
|
||||||
{
|
{
|
||||||
int i, length;
|
int i;
|
||||||
const u8 *p;
|
const u8 *p;
|
||||||
struct sk_buff *skb = precv_frame->pkt;
|
struct sk_buff *skb = precv_frame->pkt;
|
||||||
struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *) skb->data;
|
struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *) skb->data;
|
||||||
int packet_len = skb->len;
|
unsigned int length;
|
||||||
u8 ie_offset;
|
u8 ie_offset;
|
||||||
struct registry_priv *pregistrypriv = &padapter->registrypriv;
|
struct registry_priv *pregistrypriv = &padapter->registrypriv;
|
||||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||||
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
|
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
|
||||||
u16 capab_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) {
|
if (length > MAX_IE_SZ) {
|
||||||
/* DBG_8723A("IE too long for survey event\n"); */
|
/* DBG_8723A("IE too long for survey event\n"); */
|
||||||
|
Loading…
Reference in New Issue
Block a user