[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1470958194-25496-1-git-send-email-weiyj.lk@gmail.com>
Date: Thu, 11 Aug 2016 23:29:54 +0000
From: Wei Yongjun <weiyj.lk@...il.com>
To: Yuval Mintz <Yuval.Mintz@...gic.com>,
Ariel Elior <Ariel.Elior@...gic.com>,
Sudarsana Reddy Kalluru <sudarsana.kalluru@...gic.com>
Cc: Wei Yongjun <weiyj.lk@...il.com>, everest-linux-l2@...gic.com,
netdev@...r.kernel.org
Subject: [PATCH -next] qed: Fix possible memory leak in qed_dcbnl_get_ieee_pfc()
'dcbx_info is malloced in qed_dcbnl_get_ieee_pfc() and should be freed
before leaving from the error handling cases, otherwise it will cause
memory leak.
Fixes: a1d8d8a51e83 ("qed: Add dcbnl support.")
Signed-off-by: Wei Yongjun <weiyj.lk@...il.com>
---
drivers/net/ethernet/qlogic/qed/qed_dcbx.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/qlogic/qed/qed_dcbx.c b/drivers/net/ethernet/qlogic/qed/qed_dcbx.c
index 226cb08..b900dfb 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_dcbx.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_dcbx.c
@@ -1968,6 +1968,7 @@ static int qed_dcbnl_get_ieee_pfc(struct qed_dev *cdev,
if (!dcbx_info->operational.ieee) {
DP_INFO(hwfn, "DCBX is not enabled/operational in IEEE mode\n");
+ kfree(dcbx_info);
return -EINVAL;
}
Powered by blists - more mailing lists