summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/chelsio
diff options
context:
space:
mode:
authorColin Ian King <colin.king@canonical.com>2016-11-23 11:02:44 +0000
committerDavid S. Miller <davem@davemloft.net>2016-11-25 16:09:50 -0500
commit619228d86b0e32e00758dcf07ca5d06903d9a9d7 (patch)
tree92053a012587b528e567a43c2e665ca0672a827c /drivers/net/ethernet/chelsio
parent436accebb53021ef7c63535f60bda410aa87c136 (diff)
downloadblackbird-op-linux-619228d86b0e32e00758dcf07ca5d06903d9a9d7.tar.gz
blackbird-op-linux-619228d86b0e32e00758dcf07ca5d06903d9a9d7.zip
cxgb4: fix memory leak on txq_info
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> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/chelsio')
-rw-r--r--drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.c
index 565a6c6bfeaf..8098902c094a 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;
}
OpenPOWER on IntegriCloud