summaryrefslogtreecommitdiffstats
path: root/drivers/staging/rtl8712/rtl871x_mp.c
diff options
context:
space:
mode:
authorBhumika Goyal2016-02-24 11:39:31 +0100
committerGreg Kroah-Hartman2016-03-12 07:09:09 +0100
commit9155c92463ecbb55c6eca6145e139869e9ba1546 (patch)
tree91e983d48b730fbdd2a26477e452bc04701fa927 /drivers/staging/rtl8712/rtl871x_mp.c
parentstaging: rtl8712: Remove unnecessary parantheses (diff)
downloadkernel-qcow2-linux-9155c92463ecbb55c6eca6145e139869e9ba1546.tar.gz
kernel-qcow2-linux-9155c92463ecbb55c6eca6145e139869e9ba1546.tar.xz
kernel-qcow2-linux-9155c92463ecbb55c6eca6145e139869e9ba1546.zip
Staging: rtl8712: Clean up tests if NULL returned on failure
Some functions like kmalloc/usb_alloc_urb/kmalloc_array returns 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 by these functions 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/rtl8712/rtl871x_mp.c')
-rw-r--r--drivers/staging/rtl8712/rtl871x_mp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/rtl8712/rtl871x_mp.c b/drivers/staging/rtl8712/rtl871x_mp.c
index 44da4fe89381..9b5a4e7ff060 100644
--- a/drivers/staging/rtl8712/rtl871x_mp.c
+++ b/drivers/staging/rtl8712/rtl871x_mp.c
@@ -281,10 +281,10 @@ void r8712_SetChannel(struct _adapter *pAdapter)
u16 code = GEN_CMD_CODE(_SetChannel);
pcmd = kmalloc(sizeof(*pcmd), GFP_ATOMIC);
- if (pcmd == NULL)
+ if (!pcmd)
return;
pparm = kmalloc(sizeof(*pparm), GFP_ATOMIC);
- if (pparm == NULL) {
+ if (!pparm) {
kfree(pcmd);
return;
}