From: akpm@linux-foundation.org
To: mm-commits@vger.kernel.org
Cc: ben-linux@fluff.org
Subject: + lcd-fix-oops-if-driver-only-interested-in-set_power.patch added to -mm tree
Date: Tue, 18 Nov 2008 13:01:13 -0800 [thread overview]
Message-ID: <200811182101.mAIL1Dbt012930@imap1.linux-foundation.org> (raw)
The patch titled
lcd: fix oops if driver only interested in .set_power
has been added to the -mm tree. Its filename is
lcd-fix-oops-if-driver-only-interested-in-set_power.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/SubmitChecklist when testing your code ***
See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this
The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/
------------------------------------------------------
Subject: lcd: fix oops if driver only interested in .set_power
From: Ben Dooks <ben-linux@fluff.org>
The LCD driver core calls LCD drivers when either the blanking state or
the display mode has changed, but does not make any check to see if the
called driver has a .set_mode method.
This means if a driver only has a .set_power method then the system will
OOPS on changing mode (and with the console semaphore held so you cannot
easily see the problem).
Fix the problem by ensuring that either callback is valid before use.
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
drivers/video/backlight/lcd.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff -puN drivers/video/backlight/lcd.c~lcd-fix-oops-if-driver-only-interested-in-set_power drivers/video/backlight/lcd.c
--- a/drivers/video/backlight/lcd.c~lcd-fix-oops-if-driver-only-interested-in-set_power
+++ a/drivers/video/backlight/lcd.c
@@ -42,10 +42,13 @@ static int fb_notifier_callback(struct n
mutex_lock(&ld->ops_lock);
if (!ld->ops->check_fb || ld->ops->check_fb(ld, evdata->info)) {
- if (event == FB_EVENT_BLANK)
- ld->ops->set_power(ld, *(int *)evdata->data);
- else
- ld->ops->set_mode(ld, evdata->data);
+ if (event == FB_EVENT_BLANK) {
+ if (ld->ops->set_power)
+ ld->ops->set_power(ld, *(int *)evdata->data);
+ } else {
+ if (ld->ops->set_mode)
+ ld->ops->set_mode(ld, evdata->data);
+ }
}
mutex_unlock(&ld->ops_lock);
return 0;
_
Patches currently in -mm which might be from ben-linux@fluff.org are
lcd-fix-oops-if-driver-only-interested-in-set_power.patch
reply other threads:[~2008-11-18 21:01 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=200811182101.mAIL1Dbt012930@imap1.linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=ben-linux@fluff.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mm-commits@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.