mwifiex: remove unneeded kfree(NULL);
Subsystems (2)
PATCH 1/4 mwifiex: remove unneeded kfree(NULL);
The previous if statement means this that pointer is NULL so there is no need to free it.
Signed-off-by Dan Carpenter <[email protected]>
drivers/net/wireless/mwifiex/pcie.c +0 -1
@@ -386,7 +386,6 @@ static int mwifiex_pcie_create_txbd_ring(struct mwifiex_adapter *adapter) card->txbd_ring_vbase =kzalloc (card->txbd_ring_size,GFP_KERNEL );if (!card->txbd_ring_vbase) {dev_err (adapter->dev,"Unable to allocate buffer for txbd ring.\n" ); -kfree (card->txbd_ring_vbase);return -1 ; } card->txbd_ring_pbase =virt_to_phys (card->txbd_ring_vbase);
Hi Dan,
Thanks for your patch series.
Quoted 11 lines
-----Original Message-----
From: Dan Carpenter [mailto:[email protected]]
Sent: Monday, October 17, 2011 11:13 PM
To: Bing Zhao
Cc: John W. Linville; [email protected]; [email protected]
Subject: [patch 1/4] mwifiex: remove unneeded kfree(NULL);The previous if statement means this that pointer is NULL so there is no need to free it.
Signed-off-by Dan Carpenter <[email protected]>
Acked-by Bing Zhao <[email protected]>
Regards,
Bing
Quoted 13 lines
drivers/net/wireless/mwifiex/pcie.c +0
-1@@ -386,7 +386,6 @@ static int mwifiex_pcie_create_txbd_ring(struct mwifiex_adapter *adapter) card->txbd_ring_vbase =kzalloc (card->txbd_ring_size,GFP_KERNEL );if (!card->txbd_ring_vbase) {dev_err (adapter->dev,"Unable to allocate buffer for txbd ring.\n" ); -kfree (card->txbd_ring_vbase);return -1 ; } card->txbd_ring_pbase =virt_to_phys (card->txbd_ring_vbase);