提交 35762a47 编写于 作者: L Levente Kurusa 提交者: Lee Jones

backlight: core: Replace kfree with put_device

As per the comments on device_register, we shouldn't call kfree()
right after a device_register() failure. Instead call put_device(),
which in turn will call bl_device_release resulting in a kfree to the
full structure.
Signed-off-by: NLevente Kurusa <levex@linux.com>
Acked-by: NJingoo Han <jg1.han@samsung.com>
Signed-off-by: NLee Jones <lee.jones@linaro.org>
上级 fa389e22
......@@ -333,7 +333,7 @@ struct backlight_device *backlight_device_register(const char *name,
rc = device_register(&new_bd->dev);
if (rc) {
kfree(new_bd);
put_device(&new_bd->dev);
return ERR_PTR(rc);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册