From 02ee9b18dedf1d72afa0fbfb0d7c15f6b4904a07 Mon Sep 17 00:00:00 2001 From: Wei Yongjun Date: Thu, 11 Aug 2016 23:29:54 +0000 Subject: [PATCH] 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 Signed-off-by: David S. Miller --- 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 d0dc28f93c0e..d2f202eae6b2 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_dcbx.c +++ b/drivers/net/ethernet/qlogic/qed/qed_dcbx.c @@ -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; } -- 2.20.1