Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: r8188eu: 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.

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>

authored by

Larry Finger and committed by
Greg Kroah-Hartman
9452bf56 b34aa86f

+2 -2
+2 -2
drivers/staging/rtl8188eu/core/rtw_recv.c
··· 545 545 static struct recv_frame *portctrl(struct adapter *adapter, 546 546 struct recv_frame *precv_frame) 547 547 { 548 - u8 *psta_addr = NULL, *ptr; 548 + u8 *psta_addr, *ptr; 549 549 uint auth_alg; 550 550 struct recv_frame *pfhdr; 551 551 struct sta_info *psta; ··· 558 558 559 559 560 560 pstapriv = &adapter->stapriv; 561 - psta = rtw_get_stainfo(pstapriv, psta_addr); 562 561 563 562 auth_alg = adapter->securitypriv.dot11AuthAlgrthm; 564 563 ··· 565 566 pfhdr = precv_frame; 566 567 pattrib = &pfhdr->attrib; 567 568 psta_addr = pattrib->ta; 569 + psta = rtw_get_stainfo(pstapriv, psta_addr); 568 570 569 571 prtnframe = NULL; 570 572