staging: rtl8192e: Remove NULL test before vfree
PATCH v3 4/4 staging: rtl8192e: 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 <[email protected]>
--- drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/staging/rtl8192e/rtl8192e/rtl_core.c +2 -4
@@ -2697,10 +2697,8 @@ static void _rtl92e_pci_disconnect(struct pci_dev *pdev) priv->polling_timer_on =0 ;_rtl92e_down (dev, true);rtl92e_dm_deinit (dev); -if (priv->pFirmware) { -vfree (priv->pFirmware); - priv->pFirmware =NULL ; - } +vfree (priv->pFirmware); + priv->pFirmware =NULL ;destroy_workqueue (priv->priv_wq);_rtl92e_free_rx_ring (dev);for (i =0 ; i <MAX_TX_QUEUE_COUNT ; i++)
--
2.1.4
Greg KH
maintainerQuoted 21 lines · Bhaktipriya Shridhar
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;
@@(quoted diff) +0
-2-if (x != NULL) { vfree(x); x = NULL; -}
Quoted 4 lines
Signed-off-by Bhaktipriya Shridhar <[email protected]>--- drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
Patch does not apply :(