ACPI / dock: fix error return code in dock_add()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Wed, 17 Jul 2013 00:33:25 +0000 (08:33 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 25 Jul 2013 22:34:00 +0000 (00:34 +0200)
Fix to return -ENODEV in the acpi notify handler install error
handling case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/dock.c

index f601658a4ad2856464b0e137694b75c29d04d0f5..b527c1bd8bb2aaf2b27c73b4a24e86d9d3a8202f 100644 (file)
@@ -881,8 +881,10 @@ static int __init dock_add(acpi_handle handle)
 
        status = acpi_install_notify_handler(handle, ACPI_SYSTEM_NOTIFY,
                                             dock_notify_handler, dock_station);
-       if (ACPI_FAILURE(status))
+       if (ACPI_FAILURE(status)) {
+               ret = -ENODEV;
                goto err_rmgroup;
+       }
 
        dock_station_count++;
        list_add(&dock_station->sibling, &dock_stations);