提交 10ad1b73 编写于 作者: J Jean Delvare 提交者: Linus Torvalds

[PATCH] Fix error handling in backlight drivers

ERR_PTR() is supposed to be passed a negative value.
Signed-off-by: NJean Delvare <khali@linux-fr.org>
Signed-off-by: NAdrian Bunk <bunk@stusta.de>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 435a80f6
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册