public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [patch 1/4] mwifiex: remove unneeded kfree(NULL);
@ 2011-10-18  6:13 Dan Carpenter
  2011-10-18 17:57 ` Bing Zhao
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2011-10-18  6:13 UTC (permalink / raw)
  To: Bing Zhao; +Cc: John W. Linville, linux-wireless, kernel-janitors

The previous if statement means this that pointer is NULL so there
is no need to free it.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/net/wireless/mwifiex/pcie.c b/drivers/net/wireless/mwifiex/pcie.c
index d34acf0..4466976 100644
--- a/drivers/net/wireless/mwifiex/pcie.c
+++ b/drivers/net/wireless/mwifiex/pcie.c
@@ -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);

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* RE: [patch 1/4] mwifiex: remove unneeded kfree(NULL);
  2011-10-18  6:13 [patch 1/4] mwifiex: remove unneeded kfree(NULL); Dan Carpenter
@ 2011-10-18 17:57 ` Bing Zhao
  0 siblings, 0 replies; 2+ messages in thread
From: Bing Zhao @ 2011-10-18 17:57 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: John W. Linville, linux-wireless@vger.kernel.org,
	kernel-janitors@vger.kernel.org

Hi Dan,

Thanks for your patch series.

> -----Original Message-----
> From: Dan Carpenter [mailto:dan.carpenter@oracle.com]
> Sent: Monday, October 17, 2011 11:13 PM
> To: Bing Zhao
> Cc: John W. Linville; linux-wireless@vger.kernel.org; kernel-janitors@vger.kernel.org
> 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 <dan.carpenter@oracle.com>

Acked-by: Bing Zhao <bzhao@marvell.com>

Regards,
Bing

> 
> diff --git a/drivers/net/wireless/mwifiex/pcie.c b/drivers/net/wireless/mwifiex/pcie.c
> index d34acf0..4466976 100644
> --- a/drivers/net/wireless/mwifiex/pcie.c
> +++ b/drivers/net/wireless/mwifiex/pcie.c
> @@ -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);

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-10-18 17:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-18  6:13 [patch 1/4] mwifiex: remove unneeded kfree(NULL); Dan Carpenter
2011-10-18 17:57 ` Bing Zhao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox