EDAC/highbank: Fix memory leak in highbank_mc_probe()
stable inclusion from stable-v5.10.166 commit 329fbd260352a7b9a83781d8b8bd96f95844a51f category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I7TH9O Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=329fbd260352a7b9a83781d8b8bd96f95844a51f -------------------------------- [ Upstream commit e7a29365 ] When devres_open_group() fails, it returns -ENOMEM without freeing memory allocated by edac_mc_alloc(). Call edac_mc_free() on the error handling path to avoid a memory leak. [ bp: Massage commit message. ] Fixes: a1b01edb ("edac: add support for Calxeda highbank memory controller") Signed-off-by: NMiaoqian Lin <linmq006@gmail.com> Signed-off-by: NBorislav Petkov (AMD) <bp@alien8.de> Reviewed-by: NAndre Przywara <andre.przywara@arm.com> Link: https://lore.kernel.org/r/20221229054825.1361993-1-linmq006@gmail.comSigned-off-by: NSasha Levin <sashal@kernel.org> Signed-off-by: Nsanglipeng <sanglipeng1@jd.com>
Showing
想要评论请 注册 或 登录