public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Adrian Bunk <bunk@stusta.de>
To: Andrew Morton <akpm@osdl.org>
Cc: Jean Delvare <khali@linux-fr.org>,
	Jamey Hicks <jamey.hicks@hp.com>,
	Andrew Zabolotny <zap@homelink.ru>,
	LKML <linux-kernel@vger.kernel.org>
Subject: [2.6 patch] Fix error handling in backlight drivers
Date: Wed, 8 Mar 2006 23:40:48 +0100	[thread overview]
Message-ID: <20060308224048.GS4006@stusta.de> (raw)

From: Jean Delvare <khali@linux-fr.org>

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 <khali@linux-fr.org>
Signed-off-by: Adrian Bunk <bunk@stusta.de>

--- 

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(-)

--- linux-2.6.16-rc5.orig/drivers/video/backlight/backlight.c	2006-02-13 19:22:18.000000000 +0100
+++ linux-2.6.16-rc5/drivers/video/backlight/backlight.c	2006-03-05 18:39:58.000000000 +0100
@@ -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;
--- linux-2.6.16-rc5.orig/drivers/video/backlight/lcd.c	2006-02-13 19:22:18.000000000 +0100
+++ linux-2.6.16-rc5/drivers/video/backlight/lcd.c	2006-03-05 18:39:54.000000000 +0100
@@ -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;



                 reply	other threads:[~2006-03-08 22:40 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060308224048.GS4006@stusta.de \
    --to=bunk@stusta.de \
    --cc=akpm@osdl.org \
    --cc=jamey.hicks@hp.com \
    --cc=khali@linux-fr.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zap@homelink.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox