Skip to contentSkip to conversation

platform/x86: msi-wmi: Fix variable 'status' set but not used compiler warning

PATCH New Hans de Goede 1 participant 1 message Feb 4, 2021

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

PATCH 1/1 platform/x86: msi-wmi: Fix variable 'status' set but not used compiler warning

Explicitly check the status rather then relying on output.pointer staying NULL on an error.

---
 drivers/platform/x86/msi-wmi.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/platform/x86/msi-wmi.c +2 -0
index 64ee7819c9d3..fd318cdfe313 100644
@@ -96,6 +96,8 @@ static int msi_wmi_query_block(int instance, int *ret)
 	struct acpi_buffer output = { ACPI_ALLOCATE_BUFFER, NULL };
 
 	status = wmi_query_block(MSIWMI_BIOS_GUID, instance, &output);
+	if (ACPI_FAILURE(status))
+		return -EIO;
 
 	obj = output.pointer;
 
Signature · 1 line
2.29.2