summaryrefslogtreecommitdiffstats
path: root/drivers/staging/rtl8712/recv_linux.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/recv_linux.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/recv_linux.c')
-rw-r--r--drivers/staging/rtl8712/recv_linux.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/rtl8712/recv_linux.c b/drivers/staging/rtl8712/recv_linux.c
index 2f5460dbda8b..be970efcf645 100644
--- a/drivers/staging/rtl8712/recv_linux.c
+++ b/drivers/staging/rtl8712/recv_linux.c
@@ -56,7 +56,7 @@ int r8712_os_recvbuf_resource_alloc(struct _adapter *padapter,
precvbuf->irp_pending = false;
precvbuf->purb = usb_alloc_urb(0, GFP_KERNEL);
- if (precvbuf->purb == NULL)
+ if (!precvbuf->purb)
res = _FAIL;
precvbuf->pskb = NULL;
precvbuf->reuse = false;