[PATCH] Fix error handling in backlight drivers
ERR_PTR() is supposed to be passed a negative value. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
Родитель
435a80f610
Коммит
10ad1b7363
|
@ -172,7 +172,7 @@ struct backlight_device *backlight_device_register(const char *name, void *devda
|
|||
|
||||
new_bd = kmalloc(sizeof(struct backlight_device), GFP_KERNEL);
|
||||
if (unlikely(!new_bd))
|
||||
return ERR_PTR(ENOMEM);
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
init_MUTEX(&new_bd->sem);
|
||||
new_bd->props = bp;
|
||||
|
|
|
@ -171,7 +171,7 @@ struct lcd_device *lcd_device_register(const char *name, void *devdata,
|
|||
|
||||
new_ld = kmalloc(sizeof(struct lcd_device), GFP_KERNEL);
|
||||
if (unlikely(!new_ld))
|
||||
return ERR_PTR(ENOMEM);
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
init_MUTEX(&new_ld->sem);
|
||||
new_ld->props = lp;
|
||||
|
|
Загрузка…
Ссылка в новой задаче