WMI: return error if wmi_create_device() fails
authorDan Carpenter <error27@gmail.com>
Mon, 6 Dec 2010 21:44:23 +0000 (16:44 -0500)
committerMatthew Garrett <mjg@redhat.com>
Fri, 7 Jan 2011 22:03:45 +0000 (17:03 -0500)
The break resets the retval to 0 but we want to return an error code.
This was introduced in c64eefd48c4 "WMI: embed struct device directly
into wmi_block"

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
Acked-by: Dmitry Torokhov <dtor@mail.ru>
drivers/platform/x86/wmi.c

index b8e5383eab0cf917c60026ba1ff495b6f10cdc6b..05cc79672a8baf3e32b79db9400a950e4c6dcd81 100644 (file)
@@ -820,7 +820,7 @@ static acpi_status parse_wdg(acpi_handle handle)
                        retval = wmi_create_device(&gblock[i], wblock, handle);
                        if (retval) {
                                wmi_free_devices();
-                               break;
+                               goto out_free_pointer;
                        }
                }