Skip to content

Commit

Permalink
Staging: batman-adv: Remove NULL pointer check
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sven Eckelmann authored and Greg Kroah-Hartman committed Mar 4, 2010
1 parent 23a51a8 commit acdfd0e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/staging/batman-adv/hard-interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit acdfd0e

Please sign in to comment.