diff options
| author | Elise Lennion <elise.lennion@gmail.com> | 2016-10-29 03:29:57 +0300 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-10-30 18:09:03 +0300 |
| commit | 9a3ca7240bc2d300cb6b9b977bbaf475648113da (patch) | |
| tree | 16d911701307b8c3e65e86326ec115f80f209e5a | |
| parent | 6e8cb1cf26ccf99582826d20032433b1c8d57774 (diff) | |
| download | linux-9a3ca7240bc2d300cb6b9b977bbaf475648113da.tar.xz | |
staging: rtl8188eu: Standardize test for NULL.
The test for NULL of the return variable of functions was changed from
(ret == NULL) to !ret to match the standard.
Coccinelle was used with semantic patch:
@@
expression e;
identifier id, f;
statement S;
@@
f(...) { <+...
id =
\(kmalloc\|devm_kzalloc\|kmalloc_array\|devm_ioremap
\|usb_alloc_urb\|alloc_netdev\|dev_alloc_skb\) (...)
... when any
when != id = e
+ if (!id)
- if (\(NULL == id\|id == NULL\))
S
...+> }
Signed-off-by: Elise Lennion <elise.lennion@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| -rw-r--r-- | drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c b/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c index 34198fe16ca5..e2dbe1b4afd3 100644 --- a/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c +++ b/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c @@ -252,7 +252,7 @@ static int usbctrl_vendorreq(struct adapter *adapt, u8 request, u16 value, u16 i /* Acquire IO memory for vendorreq */ pIo_buf = kmalloc(MAX_USB_IO_CTL_SIZE, GFP_ATOMIC); - if (pIo_buf == NULL) { + if (!pIo_buf) { DBG_88E("[%s] pIo_buf == NULL\n", __func__); status = -ENOMEM; goto release_mutex; |
