Skip to contentSkip to conversation

WMI: return error if wmi_create_device() fails

PATCH Applied Dan Carpenter 3 participants 3 messages Nov 25, 2010 – Dec 6, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 WMI: return error if wmi_create_device() fails

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"

drivers/platform/x86/wmi.c +1 -1
index 104b77c..a5b7a4d 100644
@@ -812,7 +812,7 @@ static acpi_status parse_wdg(acpi_handle handle)
 		if (IS_ERR(wblock)) {
 			retval = PTR_ERR(wblock);
 			wmi_free_devices();
-			break;
+			goto out_free_pointer;
 		}
 
 		if (debug_event) {
Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Dan Carpenter

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"

Oops, thanks for finding it.

Quoted 13 lines
drivers/platform/x86/wmi.c +1 -1
index 104b77c..a5b7a4d 100644
@@ -812,7 +812,7 @@ static acpi_status parse_wdg(acpi_handle handle)
 		if (IS_ERR(wblock)) {
 			retval = PTR_ERR(wblock);
 			wmi_free_devices();
-			break;
+			goto out_free_pointer;
 		}
 
 		if (debug_event) {
Signature · 1 line
Dmitry