diff options
author | Bhumika Goyal | 2016-02-24 11:17:35 +0100 |
---|---|---|
committer | Greg Kroah-Hartman | 2016-03-12 07:09:09 +0100 |
commit | 61645cc3124ef012d4e8ca576aa13adf16c17393 (patch) | |
tree | 1d3b8d91429ebded20ae8b9833d49f66ea5eef46 /drivers/staging/rtl8192u/ieee80211 | |
parent | staging: rtl8192u: ieee802111: Drop Useless Initialization (diff) | |
download | kernel-qcow2-linux-61645cc3124ef012d4e8ca576aa13adf16c17393.tar.gz kernel-qcow2-linux-61645cc3124ef012d4e8ca576aa13adf16c17393.tar.xz kernel-qcow2-linux-61645cc3124ef012d4e8ca576aa13adf16c17393.zip |
Staging: rtl8192u: Clean up tests if NULL returned on failure
Some functions return Null as their return value on failure. !x is
generally preferred over x==NULL or NULL==x. So make use of !x if
the value returned on failure is NULL.
Done using coccinelle:
@@
expression e;
statement S;
@@
e = \(kmalloc\|devm_kzalloc\|kmalloc_array
\|devm_ioremap\|usb_alloc_urb\|alloc_netdev\)(...);
- if(e==NULL)
+ if(!e)
S
Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8192u/ieee80211')
-rw-r--r-- | drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c index 9dfde0794b80..879c41367e7a 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c @@ -1289,7 +1289,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, payload = skb->data + hdrlen; //ethertype = (payload[6] << 8) | payload[7]; rxb = kmalloc(sizeof(struct ieee80211_rxb), GFP_ATOMIC); - if (rxb == NULL) + if (!rxb) { IEEE80211_DEBUG(IEEE80211_DL_ERR,"%s(): kmalloc rxb error\n",__func__); goto rx_dropped; |