Skip to content

Commit

Permalink
[PATCH] Fix error handling in backlight drivers
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jean Delvare authored and Linus Torvalds committed Mar 10, 2006
1 parent 435a80f commit 10ad1b7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion drivers/video/backlight/backlight.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion drivers/video/backlight/lcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 10ad1b7

Please sign in to comment.