mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-27 22:24:11 +08:00
dmi-id: fix a memory leak in dmi_id_init error path
This patch adds a missing kfree(dmi_dev) in dmi_id_init error path. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Tejun Heo <tj@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
49c19400f6
commit
5b232f753a
@ -229,10 +229,12 @@ static int __init dmi_id_init(void)
|
||||
|
||||
ret = device_register(dmi_dev);
|
||||
if (ret)
|
||||
goto fail_class_unregister;
|
||||
goto fail_free_dmi_dev;
|
||||
|
||||
return 0;
|
||||
|
||||
fail_free_dmi_dev:
|
||||
kfree(dmi_dev);
|
||||
fail_class_unregister:
|
||||
|
||||
class_unregister(&dmi_class);
|
||||
|
Loading…
Reference in New Issue
Block a user