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

[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
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;
+1 −1
Original line number Diff line number Diff line
@@ -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;