Fix error handling in backlight drivers
Subsystems (2)
PATCH 1/1 Fix error handling in backlight drivers
From: Jean Delvare <[email protected]>
I have spotted the following problem in the way the backlight and lcd drivers handle out-of-memory errors. This should probably be fixed for 2.6.16. Note that I don't have supported hardware so I couldn't actually test the fix.
ERR_PTR() is supposed to be passed a negative value.
Signed-off-by Jean Delvare <[email protected]>
Signed-off-by Adrian Bunk <[email protected]>
---
This patch was sent by Jean Delvare on:
- 5 Mar 2006
drivers/video/backlight/backlight.c | 2 +- drivers/video/backlight/lcd.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/video/backlight/backlight.c +1 -1
@@ -172,7 +172,7 @@ 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;
drivers/video/backlight/lcd.c +1 -1
@@ -171,7 +171,7 @@ 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;