Re: 3.1rc10 null pointer dereference ideapad_backlight_notify_power

From: Sam Tygier
Date: Mon Oct 24 2011 - 17:51:51 EST


>On Thu, 20 Oct 2011, Ike Panhc wrote:
>
>> This issue has been reported[1] and patch[2] is ready.
>>
>> [1] http://www.mail-archive.com/platform-driver-x86@xxxxxxxxxxxxxxx/msg02340.html
>>
>> [2] http://www.mail-archive.com/platform-driver-x86@xxxxxxxxxxxxxxx/msg02343.html
>>    http://www.mail-archive.com/platform-driver-x86@xxxxxxxxxxxxxxx/msg02346.html
>>
>
>It certainly looks like the patch in [2] will fix the issue, but it looks
>like those are from a couple months ago and I'm still not seeing it in
>linux-next.  Matthew, how is this going to Linus and will it be cc'd to
>stable@xxxxxxxxxxxxxxx?


the patch works for me (i applied it to kernel between r10 and 3.1 final). for some reason i don't understand i had to apply the patch by hand.


my git diff says:

diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c
index 0c59541..36953bd 100644
--- a/drivers/platform/x86/ideapad-laptop.c
+++ b/drivers/platform/x86/ideapad-laptop.c
@@ -492,6 +492,9 @@ static void ideapad_backlight_notify_power(struct ideapad_private *priv)
 {
        unsigned long power;
        struct backlight_device *blightdev = priv->blightdev;
+      
+       if (!blightdev)
+               return;
 
        if (read_ec_data(ideapad_handle, 0x18, &power))
                return;


i am not quite sure of the etiquette, should I repost the patch in its original form, or my version, or can someone else get this included.

thanks

sam

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/