]> git.baikalelectronics.ru Git - kernel.git/commit
staging: rtl8192u: Clean up tests if NULL returned on failure
authorsimran singhal <singhalsimran0@gmail.com>
Sat, 4 Mar 2017 16:46:53 +0000 (22:16 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Mar 2017 17:19:07 +0000 (18:19 +0100)
commit168be07791ca1c187d9cb7c39bf3e30615e40fc0
tree64eb81e7636fe48c518437b22c84675ba36cb31e
parente4c9fd7f5385679cb0b028798b9acae712957067
staging: rtl8192u: Clean up tests if NULL returned on failure

Some functions like kmalloc/kzalloc return NULL on failure.
When NULL represents failure, !x is commonly used.

This was done using Coccinelle:
@@
expression *e;
identifier l1;
@@

e = \(kmalloc\|kzalloc\|kcalloc\|devm_kzalloc\)(...);
...
- e == NULL
+ !e

Signed-off-by: simran singhal <singhalsimran0@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c
drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_wep.c
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c