提交 5b232f75 编写于 作者: A Axel Lin 提交者: Greg Kroah-Hartman

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: NAxel Lin <axel.lin@gmail.com>
Acked-by: NTejun Heo <tj@kernel.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 49c19400
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册