提交 619228d8 编写于 作者: C Colin Ian King 提交者: David S. Miller

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: NColin Ian King <colin.king@canonical.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 436acceb
...@@ -532,7 +532,7 @@ setup_sge_txq_uld(struct adapter *adap, unsigned int uld_type, ...@@ -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), txq_info->uldtxq = kcalloc(txq_info->ntxq, sizeof(struct sge_uld_txq),
GFP_KERNEL); GFP_KERNEL);
if (!txq_info->uldtxq) { if (!txq_info->uldtxq) {
kfree(txq_info->uldtxq); kfree(txq_info);
return -ENOMEM; return -ENOMEM;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册