From f14557f93620f78adcf419f1adaa281947a5101d Mon Sep 17 00:00:00 2001 From: Tapasweni Pathak Date: Fri, 24 Oct 2014 21:45:26 +0530 Subject: [PATCH] staging: rtl8192e: Remove unnecessary code kfree on NULL pointer is a no-op. This used the following semantic patch to identify such a instance // @@ expression E; @@ - if (E != NULL) { kfree(E); } + kfree(E); @@ expression E; @@ - if (E != NULL) { kfree(E); E = NULL; } + kfree(E); + E = NULL; // 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 Signed-off-by: Tapasweni Pathak Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192e/rtllib_rx.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c index 1c2014fd8d81..ca76ad013f5f 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-- -- 2.30.2