net: fec: fix the potential memory leak in fec_enet_init()
stable inclusion from stable-v4.19.193 commit 15102886bc8f5f29daaadf2d925591d564c17e9f category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/I9BGVY CVE: CVE-2021-47150 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=15102886bc8f5f29daaadf2d925591d564c17e9f --------------------------------------------- [ Upstream commit 619fee9e ] If the memory allocated for cbd_base is failed, it should free the memory allocated for the queues, otherwise it causes memory leak. And if the memory allocated for the queues is failed, it can return error directly. Fixes: 59d0f746 ("net: fec: init multi queue date structure") Signed-off-by:Fugang Duan <fugang.duan@nxp.com> Signed-off-by:
Joakim Zhang <qiangqing.zhang@nxp.com> Signed-off-by:
David S. Miller <davem@davemloft.net> Signed-off-by:
Sasha Levin <sashal@kernel.org> Signed-off-by:
Zhang Zekun <zhangzekun11@huawei.com>
Loading
Please sign in to comment