Skip to contentSkip to conversation

cxgb4: leak on error path in setup_sge_txq_uld()

PATCH New Dan Carpenter 1 participant 1 message Nov 24, 2016

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cxgb4: leak on error path in setup_sge_txq_uld()

Freeing "txq_info->uldtxq" is a no-op. We intended to free "txq_info".

Fixes ab677ff4ad15 ("cxgb4: Allocate Tx queues dynamically")
drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.c +1 -1
index 565a6c6..8098902 100644
@@ -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;
 	}