Commit 10ad1b73 authored by Jean Delvare's avatar Jean Delvare Committed by Linus Torvalds

[PATCH] Fix error handling in backlight drivers

ERR_PTR() is supposed to be passed a negative value.
Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
Signed-off-by: default avatarAdrian Bunk <bunk@stusta.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 435a80f6
...@@ -172,7 +172,7 @@ struct backlight_device *backlight_device_register(const char *name, void *devda ...@@ -172,7 +172,7 @@ struct backlight_device *backlight_device_register(const char *name, void *devda
new_bd = kmalloc(sizeof(struct backlight_device), GFP_KERNEL); new_bd = kmalloc(sizeof(struct backlight_device), GFP_KERNEL);
if (unlikely(!new_bd)) if (unlikely(!new_bd))
return ERR_PTR(ENOMEM); return ERR_PTR(-ENOMEM);
init_MUTEX(&new_bd->sem); init_MUTEX(&new_bd->sem);
new_bd->props = bp; new_bd->props = bp;
......
...@@ -171,7 +171,7 @@ struct lcd_device *lcd_device_register(const char *name, void *devdata, ...@@ -171,7 +171,7 @@ struct lcd_device *lcd_device_register(const char *name, void *devdata,
new_ld = kmalloc(sizeof(struct lcd_device), GFP_KERNEL); new_ld = kmalloc(sizeof(struct lcd_device), GFP_KERNEL);
if (unlikely(!new_ld)) if (unlikely(!new_ld))
return ERR_PTR(ENOMEM); return ERR_PTR(-ENOMEM);
init_MUTEX(&new_ld->sem); init_MUTEX(&new_ld->sem);
new_ld->props = lp; new_ld->props = lp;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment