[PATCH] Fix error handling in backlight drivers
authorJean Delvare <khali@linux-fr.org>
Fri, 10 Mar 2006 01:33:36 +0000 (17:33 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Fri, 10 Mar 2006 03:47:37 +0000 (19:47 -0800)
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>
drivers/video/backlight/backlight.c
drivers/video/backlight/lcd.c

index bd39bbd88d41e7042e7fa76bf2a35e1c3145ebbc..151fda8dded005fb4209a13ee5702e32108bb404 100644 (file)
@@ -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;
index 9e32485ee7bbc448da71b86c7e89fd4b76ffb2ea..86908a60c630d9624fab519c24d1ab0f28091e3b 100644 (file)
@@ -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;