sony-laptop: return negative on failure in sony_nc_add()
authorDan Carpenter <error27@gmail.com>
Sat, 26 Feb 2011 12:54:57 +0000 (15:54 +0300)
committerMatthew Garrett <mjg@redhat.com>
Mon, 28 Mar 2011 10:07:25 +0000 (06:07 -0400)
There were two places in sony_nc_add() where we returned zero on failure
instead of a negative error code.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
drivers/platform/x86/sony-laptop.c

index 60d8334..363b89e 100644 (file)
@@ -1594,9 +1594,11 @@ static int sony_nc_add(struct acpi_device *device)
        if (ACPI_SUCCESS(acpi_get_handle(sony_nc_acpi_handle, "SN00",
                                         &handle))) {
                dprintk("Doing SNC setup\n");
-               if (sony_nc_handles_setup(sony_pf_device))
+               result = sony_nc_handles_setup(sony_pf_device);
+               if (result)
                        goto outpresent;
-               if (sony_nc_kbd_backlight_setup(sony_pf_device))
+               result = sony_nc_kbd_backlight_setup(sony_pf_device);
+               if (result)
                        goto outsnc;
                sony_nc_function_setup(device);
                sony_nc_rfkill_setup(device);