Skip to content

Commit 02ee9b1

Browse files
weiyjdavem330
authored andcommitted
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: a1d8d8a ("qed: Add dcbnl support.") Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 2fb876b commit 02ee9b1

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎drivers/net/ethernet/qlogic/qed/qed_dcbx.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1855,6 +1855,7 @@ static int qed_dcbnl_get_ieee_pfc(struct qed_dev *cdev,
18551855

18561856
if (!dcbx_info->operational.ieee) {
18571857
DP_INFO(hwfn, "DCBX is not enabled/operational in IEEE mode\n");
1858+
kfree(dcbx_info);
18581859
return -EINVAL;
18591860
}
18601861

0 commit comments

Comments
 (0)