staging: rtl8188eu: os_dep: Remove NULL test before vfree
authorBhaktipriya Shridhar <[email protected]>
Sun, 28 Feb 2016 20:30:17 +0000 (02:00 +0530)
committerGreg Kroah-Hartman <[email protected]>
Sat, 12 Mar 2016 06:09:09 +0000 (22:09 -0800)
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 <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
drivers/staging/rtl8188eu/os_dep/usb_intf.c

index 6a68f175931283a4c9b169470a6f2731bf287c36..e8d223669941b9e5865d27a2861b812b6d87fc16 100644 (file)
@@ -442,7 +442,7 @@ free_adapter:
        if (status != _SUCCESS) {
                if (pnetdev)
                        rtw_free_netdev(pnetdev);
-               else if (padapter)
+               else
                        vfree(padapter);
                padapter = NULL;
        }