staging: rtl8723bs: remove meaningless pstat->passoc_req check in OnAssocReq()
PATCH 1/1 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 possible.
--- drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c +3 -5
@@ -1344,11 +1344,9 @@ 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->passoc_req =NULL ; + pstat->assoc_req_len =0 ; pstat->passoc_req =rtw_zmalloc (pkt_len);if (pstat->passoc_req) {
Signature · 1 line
2.20.1
Quoted 5 lines · CEST guolongji
kfree(NULL) is safe and the check 'if (
pstat->passoc_req)' before kfree is not possible.Signed-off-by guolongji <[email protected]>---
Why is it "not possible"? Do you get syntax errors? Are the logic and the result of the function altered? If not, control is certainly "possible".
Remember that something may be unnecessary and redundant even if it is still possible.
Regards,
Fabio
Greg KH
maintainerQuoted 4 lines · guolongji
kfree(NULL) is safe and the check 'if (
pstat->passoc_req)' before kfree is not possible.Signed-off-by guolongji <[email protected]>
We need a "full" or "real" name here. Do you really sign documents with a lower-case "g" like this? If so, great, just have to check.
thanks,
greg k-h