Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Wei Yongjun and committed by
David S. Miller
02ee9b18 2fb876b2

+1
+1
drivers/net/ethernet/qlogic/qed/qed_dcbx.c
··· 1855 1855 1856 1856 if (!dcbx_info->operational.ieee) { 1857 1857 DP_INFO(hwfn, "DCBX is not enabled/operational in IEEE mode\n"); 1858 + kfree(dcbx_info); 1858 1859 return -EINVAL; 1859 1860 } 1860 1861