From acdfd0e088502dc225f594b5a5598cab53ffd375 Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Sat, 2 Jan 2010 11:30:36 +0100 Subject: [PATCH] Staging: batman-adv: Remove NULL pointer check It is safe to call kfree(NULL) which makes this extra check unneeded. It was found using checkpatch.pl from linux-2.6 Signed-off-by: Sven Eckelmann Acked-by: Simon Wunderlich Signed-off-by: Andrew Lunn Signed-off-by: Greg Kroah-Hartman --- drivers/staging/batman-adv/hard-interface.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/batman-adv/hard-interface.c b/drivers/staging/batman-adv/hard-interface.c index e9cb977d0016..28d02f68a3f8 100644 --- a/drivers/staging/batman-adv/hard-interface.c +++ b/drivers/staging/batman-adv/hard-interface.c @@ -399,8 +399,7 @@ int hardif_add_interface(char *dev, int if_num) return 1; out: - if (batman_if->packet_buff) - kfree(batman_if->packet_buff); + kfree(batman_if->packet_buff); kfree(batman_if); kfree(dev); return -1; -- 2.39.5