mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-10 15:10:38 +00:00
staging: rtl8723bs: hal: Remove NULL check before kfree
NULL check before kfree is unnecessary so remove it. The following Coccinelle script was used to detect this: @@ expression E; @@ - if (E != NULL) { kfree(E); } + kfree(E); @@ expression E; @@ - if (E != NULL) { kfree(E); E = NULL; } + kfree(E); + E = NULL; Signed-off-by: Simran Singhal <singhalsimran0@gmail.com> Link: https://lore.kernel.org/r/20200326132823.GA18625@simran-Inspiron-5558 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
1879d30ede
commit
b67b7b0465
@ -480,10 +480,8 @@ initbuferror:
|
||||
precvpriv->precv_buf = NULL;
|
||||
}
|
||||
|
||||
if (precvpriv->pallocated_recv_buf) {
|
||||
kfree(precvpriv->pallocated_recv_buf);
|
||||
precvpriv->pallocated_recv_buf = NULL;
|
||||
}
|
||||
kfree(precvpriv->pallocated_recv_buf);
|
||||
precvpriv->pallocated_recv_buf = NULL;
|
||||
|
||||
exit:
|
||||
return res;
|
||||
@ -518,8 +516,6 @@ void rtl8723bs_free_recv_priv(struct adapter *padapter)
|
||||
precvpriv->precv_buf = NULL;
|
||||
}
|
||||
|
||||
if (precvpriv->pallocated_recv_buf) {
|
||||
kfree(precvpriv->pallocated_recv_buf);
|
||||
precvpriv->pallocated_recv_buf = NULL;
|
||||
}
|
||||
kfree(precvpriv->pallocated_recv_buf);
|
||||
precvpriv->pallocated_recv_buf = NULL;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user