aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/rtl8192e
diff options
context:
space:
mode:
authorTapasweni Pathak <tapaswenipathak@gmail.com>2014-10-24 16:15:26 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-10-27 02:33:06 (GMT)
commitf14557f93620f78adcf419f1adaa281947a5101d (patch)
tree331ace7aa58b0cce754c23642882e301234db655 /drivers/staging/rtl8192e
parent4475cf2ebff33bf669661daab4fa6e9eec349552 (diff)
staging: rtl8192e: Remove unnecessary code
kfree on NULL pointer is a no-op. This used the following semantic patch to identify such a instance // <smpl> @@ expression E; @@ - if (E != NULL) { kfree(E); } + kfree(E); @@ expression E; @@ - if (E != NULL) { kfree(E); E = NULL; } + kfree(E); + E = NULL; // </smpl> As rxb is always null at this point, so the code to kfree it and intializing it to NULL is removed completely. Suggested by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8192e')
-rw-r--r--drivers/staging/rtl8192e/rtllib_rx.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c
index 1c2014f..ca76ad0 100644
--- a/drivers/staging/rtl8192e/rtllib_rx.c
+++ b/drivers/staging/rtl8192e/rtllib_rx.c
@@ -1415,10 +1415,6 @@ static int rtllib_rx_InfraAdhoc(struct rtllib_device *ieee, struct sk_buff *skb,
return 1;
rx_dropped:
- if (rxb != NULL) {
- kfree(rxb);
- rxb = NULL;
- }
ieee->stats.rx_dropped++;
/* Returning 0 indicates to caller that we have not handled the SKB--

Privacy Policy