kernel/module: Fix mem leak in module_add_modinfo_attrs
[ Upstream commit bc6f2a757d525e001268c3658bd88822e768f8db ] In module_add_modinfo_attrs if sysfs_create_file fails, we forget to free allocated modinfo_attrs and roll back the sysfs files. Fixes: 03e88ae1 ("[PATCH] fix module sysfs files reference counting") Reviewed-by: NMiroslav Benes <mbenes@suse.cz> Signed-off-by: NYueHaibing <yuehaibing@huawei.com> Signed-off-by: NJessica Yu <jeyu@kernel.org> Signed-off-by: NSasha Levin <sashal@kernel.org> Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Showing
想要评论请 注册 或 登录