From: Bhaktipriya Shridhar Date: Sun, 28 Feb 2016 20:30:17 +0000 (+0530) Subject: staging: rtl8188eu: os_dep: Remove NULL test before vfree X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=2c10efbd070624b742068d8050f3e95d7e1d9375;p=linux-beck.git 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/rtl8188eu/os_dep/usb_intf.c b/drivers/staging/rtl8188eu/os_dep/usb_intf.c index 6a68f1759312..e8d223669941 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; }