diff options
author | Bhaktipriya Shridhar <bhaktipriya96@gmail.com> | 2016-02-29 02:00:17 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-03-11 22:09:09 -0800 |
commit | 2c10efbd070624b742068d8050f3e95d7e1d9375 (patch) | |
tree | 3de207a29eb1e526b9851a19ca55350902f98d68 | |
parent | 7570ad910445d3c38bc0a5f0a82606e4861f85a6 (diff) | |
download | op-kernel-dev-2c10efbd070624b742068d8050f3e95d7e1d9375.zip op-kernel-dev-2c10efbd070624b742068d8050f3e95d7e1d9375.tar.gz |
staging: rtl8188eu: os_dep: Remove NULL test before vfree
vfree frees the virtually continuous memory area starting at addr.
If addr is NULL, no operation is performed. So NULL test is not needed
before vfree.
This was done using Coccinelle:
@@
expression x;
@@
-if (x != NULL)
vfree(x);
@@
expression x;
@@
-if (x != NULL) {
vfree(x);
x = NULL;
-}
Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/rtl8188eu/os_dep/usb_intf.c | 2 |
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 6a68f17..e8d2236 100644 --- a/drivers/staging/rtl8188eu/os_dep/usb_intf.c +++ b/drivers/staging/rtl8188eu/os_dep/usb_intf.c @@ -442,7 +442,7 @@ free_adapter: if (status != _SUCCESS) { if (pnetdev) rtw_free_netdev(pnetdev); - else if (padapter) + else vfree(padapter); padapter = NULL; } |