[lkml]   [2007]   [Aug]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    Patch in this message
    Subject[2.6.23 regression fix] fix thinkpad_acpi without hardware
    René Treffer reported that booting a CONFIG_THINKPAD_ACPI=y kernel on a 
    machine without the hardware results in an Oops.

    The trace is thinkpad_acpi_module_init -> thinkpad_acpi_module_exit ->
    driver_remove_file -> sysfs_hash_and_remove.

    The error handling if thinkpad_acpi_module_init() fails generally looks
    suspicious, but this patch at least fixes the common case if no hardware
    was found, and it seems in this case there isn't any cleanup
    actually required.

    Broken by commit d5a2f2f1d68e2da538ac28540cddd9ccc733b001.

    Signed-off-by: Adrian Bunk <>

    diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c
    index fa80f35..c7432a7 100644
    --- a/drivers/misc/thinkpad_acpi.c
    +++ b/drivers/misc/thinkpad_acpi.c
    @@ -4644,10 +4644,8 @@ static int __init thinkpad_acpi_module_init(void)

    ret = probe_for_thinkpad();
    - if (ret) {
    - thinkpad_acpi_module_exit();
    + if (ret)
    return ret;
    - }

    /* Driver initialization */

    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at

     \ /
      Last update: 2007-08-05 21:57    [W:0.022 / U:1.000 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site