diff mbox

[1/1] caif: Remove redundant null check before kfree in cfctrl.c

Message ID 1353408838-28678-1-git-send-email-sachin.kamat@linaro.org
State Accepted
Headers show

Commit Message

Sachin Kamat Nov. 20, 2012, 10:53 a.m. UTC
kfree on a null pointer is a no-op.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 net/caif/cfctrl.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

Comments

Sjur BRENDELAND Nov. 20, 2012, 11:04 a.m. UTC | #1
> kfree on a null pointer is a no-op.
> 
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Acked-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
David Miller Nov. 20, 2012, 8:53 p.m. UTC | #2
From: Sjur BRENDELAND <sjur.brandeland@stericsson.com>
Date: Tue, 20 Nov 2012 12:04:23 +0100

>> kfree on a null pointer is a no-op.
>> 
>> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
> Acked-by: Sjur Brændeland <sjur.brandeland@stericsson.com>

Applied.
diff mbox

Patch

diff --git a/net/caif/cfctrl.c b/net/caif/cfctrl.c
index 44f270f..a376ec1 100644
--- a/net/caif/cfctrl.c
+++ b/net/caif/cfctrl.c
@@ -515,8 +515,7 @@  static int cfctrl_recv(struct cflayer *layer, struct cfpkt *pkt)
 							  client_layer : NULL);
 			}
 
-			if (req != NULL)
-				kfree(req);
+			kfree(req);
 
 			spin_unlock_bh(&cfctrl->info_list_lock);
 		}