Staging: batman-adv: Remove NULL pointer check
authorSven Eckelmann <sven.eckelmann@gmx.de>
Sat, 2 Jan 2010 10:30:36 +0000 (11:30 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 4 Mar 2010 00:42:34 +0000 (16:42 -0800)
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 <sven.eckelmann@gmx.de>
Acked-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/batman-adv/hard-interface.c

index e9cb977d00169cfebff4169348aadc400de28c75..28d02f68a3f8c0d432102f1cc7143088a3b47d37 100644 (file)
@@ -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;