mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-01 06:33:07 +00:00
staging: rtl8723bs: remove meaningless pstat->passoc_req check in OnAssocReq()
kfree(NULL) is safe and the check 'if (pstat->passoc_req)' before kfree is not necessary. Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Longji Guo <guolongji@uniontech.com> Link: https://lore.kernel.org/r/20210929110613.29979-1-guolongji@uniontech.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
6649335e1f
commit
42bdb41d2e
1 changed files with 2 additions and 6 deletions
|
@ -1344,12 +1344,8 @@ unsigned int OnAssocReq(struct adapter *padapter, union recv_frame *precv_frame)
|
|||
issue_asocrsp(padapter, status, pstat, WIFI_REASSOCRSP);
|
||||
|
||||
spin_lock_bh(&pstat->lock);
|
||||
if (pstat->passoc_req) {
|
||||
kfree(pstat->passoc_req);
|
||||
pstat->passoc_req = NULL;
|
||||
pstat->assoc_req_len = 0;
|
||||
}
|
||||
|
||||
kfree(pstat->passoc_req);
|
||||
pstat->assoc_req_len = 0;
|
||||
pstat->passoc_req = rtw_zmalloc(pkt_len);
|
||||
if (pstat->passoc_req) {
|
||||
memcpy(pstat->passoc_req, pframe, pkt_len);
|
||||
|
|
Loading…
Reference in a new issue