Commit 02ee9b18 authored by Wei Yongjun's avatar Wei Yongjun Committed by David S. Miller

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: a1d8d8a5 ("qed: Add dcbnl support.")
Signed-off-by: default avatarWei Yongjun <weiyj.lk@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2fb876b2
......@@ -1855,6 +1855,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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment