]> git.karo-electronics.de Git - linux-beck.git/commit
staging: rtl8192e: Remove unnecessary code
authorTapasweni Pathak <tapaswenipathak@gmail.com>
Fri, 24 Oct 2014 16:15:26 +0000 (21:45 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Oct 2014 02:33:06 +0000 (10:33 +0800)
commitf14557f93620f78adcf419f1adaa281947a5101d
tree331ace7aa58b0cce754c23642882e301234db655
parent4475cf2ebff33bf669661daab4fa6e9eec349552
staging: rtl8192e: Remove unnecessary code

kfree on NULL pointer is a no-op.

This used the following semantic patch to identify such a instance

// <smpl>
@@ expression E; @@
- if (E != NULL) { kfree(E); }
+ kfree(E);
@@ expression E; @@
- if (E != NULL) { kfree(E); E = NULL; }
+ kfree(E);
+ E = NULL;
// </smpl>

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 <julia.lawall@lip6.fr>
Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8192e/rtllib_rx.c