All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cxgb4: fix memory leak on txq_info
@ 2016-11-23 11:02 Colin King
  2016-11-25 21:10 ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Colin King @ 2016-11-23 11:02 UTC (permalink / raw)
  To: Hariprasad S, netdev; +Cc: linux-kernel

From: Colin Ian King <colin.king@canonical.com>

Currently if txq_info->uldtxq cannot be allocated then
txq_info->txq is being kfree'd (which is redundant because it
is NULL) instead of txq_info. Fix this by instead kfree'ing
txq_info.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.c
index 565a6c6..8098902 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.c
@@ -532,7 +532,7 @@ setup_sge_txq_uld(struct adapter *adap, unsigned int uld_type,
 	txq_info->uldtxq = kcalloc(txq_info->ntxq, sizeof(struct sge_uld_txq),
 				   GFP_KERNEL);
 	if (!txq_info->uldtxq) {
-		kfree(txq_info->uldtxq);
+		kfree(txq_info);
 		return -ENOMEM;
 	}
 
-- 
2.10.2

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

* Re: [PATCH] cxgb4: fix memory leak on txq_info
  2016-11-23 11:02 [PATCH] cxgb4: fix memory leak on txq_info Colin King
@ 2016-11-25 21:10 ` David Miller
  2016-11-25 21:28   ` Colin Ian King
  0 siblings, 1 reply; 3+ messages in thread
From: David Miller @ 2016-11-25 21:10 UTC (permalink / raw)
  To: colin.king; +Cc: hariprasad, netdev, linux-kernel

From: Colin King <colin.king@canonical.com>
Date: Wed, 23 Nov 2016 11:02:44 +0000

> From: Colin Ian King <colin.king@canonical.com>
> 
> Currently if txq_info->uldtxq cannot be allocated then
> txq_info->txq is being kfree'd (which is redundant because it
> is NULL) instead of txq_info. Fix this by instead kfree'ing
> txq_info.
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Applied, but Colin you _really_ need to start properly marking your
networking patch submissions by indicating in the subject which
tree your change is for.  In this case I figured out it was
net-next, but you must say this explicitly in the Subject line
via "Subject: [PATCH net-next] ..."

Thanks.

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

* Re: [PATCH] cxgb4: fix memory leak on txq_info
  2016-11-25 21:10 ` David Miller
@ 2016-11-25 21:28   ` Colin Ian King
  0 siblings, 0 replies; 3+ messages in thread
From: Colin Ian King @ 2016-11-25 21:28 UTC (permalink / raw)
  To: David Miller; +Cc: hariprasad, netdev, linux-kernel

On 25/11/16 21:10, David Miller wrote:
> From: Colin King <colin.king@canonical.com>
> Date: Wed, 23 Nov 2016 11:02:44 +0000
> 
>> From: Colin Ian King <colin.king@canonical.com>
>>
>> Currently if txq_info->uldtxq cannot be allocated then
>> txq_info->txq is being kfree'd (which is redundant because it
>> is NULL) instead of txq_info. Fix this by instead kfree'ing
>> txq_info.
>>
>> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> 
> Applied, but Colin you _really_ need to start properly marking your
> networking patch submissions by indicating in the subject which
> tree your change is for.  In this case I figured out it was
> net-next, but you must say this explicitly in the Subject line
> via "Subject: [PATCH net-next] ..."
> 
> Thanks.
> 
Understood, will do next time, apologies for that.

Colin

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

end of thread, other threads:[~2016-11-25 21:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-23 11:02 [PATCH] cxgb4: fix memory leak on txq_info Colin King
2016-11-25 21:10 ` David Miller
2016-11-25 21:28   ` Colin Ian King

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.