APPLIED: APPLIED: [PATCH 0/2][Precise] ASUS ET2012 series machines

AceLan Kao acelan.kao at canonical.com
Tue Apr 3 01:39:37 UTC 2012


Dear Tim,

In this function
 static void eeepc_wmi_quirks(struct asus_wmi_driver *driver)
 {
-       driver->panel_power = FB_BLANK_UNBLANK;
-       driver->quirks = &quirk_asus_unknown;
-       driver->quirks->hotplug_wireless = hotplug_wireless;
-       driver->quirks->wapf = -1;
+       quirks = &quirk_asus_unknown;
+       quirks->hotplug_wireless = hotplug_wireless;
+
        dmi_check_system(asus_quirks);
+
        driver->quirks = quirks;
+       driver->quirks->wapf = -1;
+       driver->panel_power = FB_BLANK_UNBLANK;
 }

"driver->quirks" will become NULL if dmi_check_system() doesn't match any quirk.

This line actually prevents the NULL pointer be assigned to
"driver->quirks" after dmi_check_system()
+       quirks = &quirk_asus_unknown;

I think it's fixed accidentally, since the driver maintainer's machine
and mine all match the quirk.

Best regards,
AceLan Kao.

2012/4/2 Tim Gardner <tim.gardner at canonical.com>:
> The commit log for c55d995dd3cebffdeb2b7eff8acc813c56d62c97 is
> non-existent, so its hard to tell from the patch just _how_ it avoids a
> potential NULL memory access.
>
> --
> Tim Gardner tim.gardner at canonical.com



-- 
Chia-Lin Kao(AceLan)
http://blog.acelan.idv.tw/
E-Mail: acelan.kaoATcanonical.com (s/AT/@/)




More information about the kernel-team mailing list