aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorLevente Kurusa <levex@linux.com>2014-02-07 09:43:21 +0100
committerLee Jones <lee.jones@linaro.org>2014-04-08 13:20:39 +0100
commit35762a47c0a24072a689cbd98ecf8c62b037ef8a (patch)
tree5c77d93917fd60eb2fb3b0b4f9a3c3fb5d9d4383 /drivers/video
parentLinux 3.14-rc6 (diff)
downloadlinux-dev-35762a47c0a24072a689cbd98ecf8c62b037ef8a.tar.xz
linux-dev-35762a47c0a24072a689cbd98ecf8c62b037ef8a.zip
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: Levente Kurusa <levex@linux.com> Acked-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/backlight/backlight.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backlight/backlight.c
index 5d05555fe841..20b276e1f894 100644
--- a/drivers/video/backlight/backlight.c
+++ b/drivers/video/backlight/backlight.c
@@ -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);
}