Commit 5ecf6d0b authored by Larry Finger's avatar Larry Finger Committed by Jiri Slaby

staging: r8188eu: Calling rtw_get_stainfo() with a NULL sta_addr will return NULL

commit 9452bf56 upstream.

This makes the follow-on check for psta != NULL pointless and makes
the whole exercise rather pointless. This is another case of why
blindly zero-initializing variables when they are declared is bad.
Reported-by: default avatarJes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
parent 8ed38426
...@@ -555,7 +555,7 @@ _func_exit_; ...@@ -555,7 +555,7 @@ _func_exit_;
/* set the security information in the recv_frame */ /* set the security information in the recv_frame */
static union recv_frame *portctrl(struct adapter *adapter, union recv_frame *precv_frame) static union recv_frame *portctrl(struct adapter *adapter, union recv_frame *precv_frame)
{ {
u8 *psta_addr = NULL, *ptr; u8 *psta_addr, *ptr;
uint auth_alg; uint auth_alg;
struct recv_frame_hdr *pfhdr; struct recv_frame_hdr *pfhdr;
struct sta_info *psta; struct sta_info *psta;
...@@ -569,7 +569,6 @@ static union recv_frame *portctrl(struct adapter *adapter, union recv_frame *pre ...@@ -569,7 +569,6 @@ static union recv_frame *portctrl(struct adapter *adapter, union recv_frame *pre
_func_enter_; _func_enter_;
pstapriv = &adapter->stapriv; pstapriv = &adapter->stapriv;
psta = rtw_get_stainfo(pstapriv, psta_addr);
auth_alg = adapter->securitypriv.dot11AuthAlgrthm; auth_alg = adapter->securitypriv.dot11AuthAlgrthm;
...@@ -577,6 +576,7 @@ _func_enter_; ...@@ -577,6 +576,7 @@ _func_enter_;
pfhdr = &precv_frame->u.hdr; pfhdr = &precv_frame->u.hdr;
pattrib = &pfhdr->attrib; pattrib = &pfhdr->attrib;
psta_addr = pattrib->ta; psta_addr = pattrib->ta;
psta = rtw_get_stainfo(pstapriv, psta_addr);
prtnframe = NULL; prtnframe = NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment