Commit b67b7b04 authored by Simran Singhal's avatar Simran Singhal Committed by Greg Kroah-Hartman

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: default avatarSimran Singhal <singhalsimran0@gmail.com>
Link: https://lore.kernel.org/r/20200326132823.GA18625@simran-Inspiron-5558Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1879d30e
...@@ -480,10 +480,8 @@ s32 rtl8723bs_init_recv_priv(struct adapter *padapter) ...@@ -480,10 +480,8 @@ s32 rtl8723bs_init_recv_priv(struct adapter *padapter)
precvpriv->precv_buf = NULL; precvpriv->precv_buf = NULL;
} }
if (precvpriv->pallocated_recv_buf) { kfree(precvpriv->pallocated_recv_buf);
kfree(precvpriv->pallocated_recv_buf); precvpriv->pallocated_recv_buf = NULL;
precvpriv->pallocated_recv_buf = NULL;
}
exit: exit:
return res; return res;
...@@ -518,8 +516,6 @@ void rtl8723bs_free_recv_priv(struct adapter *padapter) ...@@ -518,8 +516,6 @@ void rtl8723bs_free_recv_priv(struct adapter *padapter)
precvpriv->precv_buf = NULL; precvpriv->precv_buf = NULL;
} }
if (precvpriv->pallocated_recv_buf) { kfree(precvpriv->pallocated_recv_buf);
kfree(precvpriv->pallocated_recv_buf); precvpriv->pallocated_recv_buf = NULL;
precvpriv->pallocated_recv_buf = NULL;
}
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment