staging: rtl8723au: Calling rtw_get_stainfo() with a NULL sta_addr will 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.

This bug seems to be present in multiple drivers provided by Realtek.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Jes Sorensen 2014-04-09 23:21:22 +02:00 committed by Greg Kroah-Hartman
parent 514c485c01
commit 7d0d2b15a0

View File

@ -569,7 +569,7 @@ struct recv_frame *decryptor(struct rtw_adapter *padapter,
static struct recv_frame *portctrl(struct rtw_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;
@ -580,7 +580,6 @@ static struct recv_frame *portctrl(struct rtw_adapter *adapter,
struct rx_pkt_attrib *pattrib;
pstapriv = &adapter->stapriv;
psta = rtw_get_stainfo23a(pstapriv, psta_addr);
auth_alg = adapter->securitypriv.dot11AuthAlgrthm;
@ -588,6 +587,7 @@ static struct recv_frame *portctrl(struct rtw_adapter *adapter,
pfhdr = precv_frame;
pattrib = &pfhdr->attrib;
psta_addr = pattrib->ta;
psta = rtw_get_stainfo23a(pstapriv, psta_addr);
RT_TRACE(_module_rtl871x_recv_c_, _drv_info_,
("########portctrl:adapter->securitypriv.dot11AuthAlgrthm ="