Skip to content

Commit

Permalink
staging: r8188eu: Calling rtw_get_stainfo() with a NULL sta_addr will…
Browse files Browse the repository at this point in the history
… return NULL

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: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Larry Finger authored and Greg Kroah-Hartman committed Apr 16, 2014
1 parent b34aa86 commit 9452bf5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/staging/rtl8188eu/core/rtw_recv.c
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ static struct recv_frame *decryptor(struct adapter *padapter,
static struct recv_frame *portctrl(struct adapter *adapter,
struct recv_frame *precv_frame)
{
u8 *psta_addr = NULL, *ptr;
u8 *psta_addr, *ptr;
uint auth_alg;
struct recv_frame *pfhdr;
struct sta_info *psta;
Expand All @@ -558,14 +558,14 @@ static struct recv_frame *portctrl(struct adapter *adapter,


pstapriv = &adapter->stapriv;
psta = rtw_get_stainfo(pstapriv, psta_addr);

auth_alg = adapter->securitypriv.dot11AuthAlgrthm;

ptr = precv_frame->rx_data;
pfhdr = precv_frame;
pattrib = &pfhdr->attrib;
psta_addr = pattrib->ta;
psta = rtw_get_stainfo(pstapriv, psta_addr);

prtnframe = NULL;

Expand Down

0 comments on commit 9452bf5

Please sign in to comment.