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

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-5558


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1879d30e
Loading
Loading
Loading
Loading
+4 −8
Original line number Diff line number Diff line
@@ -480,10 +480,8 @@ initbuferror:
		precvpriv->precv_buf = NULL;
	}

	if (precvpriv->pallocated_recv_buf) {
	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;
}
}