brcmfmac: fix end of loop check (signedness bug)
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 10 Oct 2012 18:13:12 +0000 (11:13 -0700)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 15 Oct 2012 18:45:34 +0000 (14:45 -0400)
commit3e4f319dacc60c1b4537b85329d393ad18bf7501
tree20f78805a34fe1a524127c6da84954c5f2a09dfd
parent5dd161ff7b46029c9da4f4ef8b214b8ba4316445
brcmfmac: fix end of loop check (signedness bug)

The problem here is that we loop until "remained_buf_len" is less than
zero, but since it is unsigned, it never is.

"remained_buf_len" has to be large enough to hold the value from
"mgmt_ie_buf_len".  That variable is type u32, but it only holds small
values so I have changed to both variables to int.

Also I removed the bogus initialization from "mgmt_ie_buf_len" so that
GCC can detect if it is used unitialized.  I moved the declaration of
"remained_buf_len" closer to where it is used so it's easier to read.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c