summaryrefslogtreecommitdiff
path: root/drivers/staging/rtl8188eu/os_dep/usb_intf.c
diff options
context:
space:
mode:
authorBhaktipriya Shridhar <bhaktipriya96@gmail.com>2016-03-22 20:25:55 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-03-28 07:30:36 -0700
commit574502caed4c11c7bbb6b4532a8bb544f626f2dc (patch)
treed399e6fe4609c7a0be9f271ca4fd1f75f69b4b50 /drivers/staging/rtl8188eu/os_dep/usb_intf.c
parent6e9aeda3fa6fb1462cfc3d188ecfa734b1af6b21 (diff)
staging: rtl8188eu: os_dep: usb_intf: 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: Bhaktipriya Shridhar <bhaktipriya96@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8188eu/os_dep/usb_intf.c')
-rw-r--r--drivers/staging/rtl8188eu/os_dep/usb_intf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/rtl8188eu/os_dep/usb_intf.c b/drivers/staging/rtl8188eu/os_dep/usb_intf.c
index 8fd608d6027a..11d51a30170f 100644
--- a/drivers/staging/rtl8188eu/os_dep/usb_intf.c
+++ b/drivers/staging/rtl8188eu/os_dep/usb_intf.c
@@ -60,7 +60,7 @@ static struct dvobj_priv *usb_dvobj_init(struct usb_interface *usb_intf)
struct usb_device *pusbd;
pdvobjpriv = kzalloc(sizeof(*pdvobjpriv), GFP_KERNEL);
- if (pdvobjpriv == NULL)
+ if (!pdvobjpriv)
return NULL;
pdvobjpriv->pusbintf = usb_intf;