aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans de Goede <[email protected]>2021-02-04 12:38:48 +0100
committerHans de Goede <[email protected]>2021-02-04 13:23:55 +0100
commitf807f4b7b32db00fc8622289644362e0695989bb (patch)
tree3855f86f3888d000b0dbca0531efc4bc9a26c0ec
parentf1e1ea516721d1ea0b21327ff9e6cb2c2bb86e28 (diff)
platform/surface: surface3-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. This silences the following compiler warning: drivers/platform/surface/surface3-wmi.c:60:14: warning: variable 'status' set but not used [-Wunused-but-set-variable] Reported-by: kernel test robot <[email protected]> Reviewed-by: Maximilian Luz <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Link: https://lore.kernel.org/r/[email protected]
-rw-r--r--drivers/platform/surface/surface3-wmi.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/platform/surface/surface3-wmi.c b/drivers/platform/surface/surface3-wmi.c
index 130b6f52a600..fcd1d4fb94d5 100644
--- a/drivers/platform/surface/surface3-wmi.c
+++ b/drivers/platform/surface/surface3-wmi.c
@@ -57,12 +57,16 @@ static DEFINE_MUTEX(s3_wmi_lock);
static int s3_wmi_query_block(const char *guid, int instance, int *ret)
{
struct acpi_buffer output = { ACPI_ALLOCATE_BUFFER, NULL };
+ union acpi_object *obj = NULL;
acpi_status status;
- union acpi_object *obj;
int error = 0;
mutex_lock(&s3_wmi_lock);
status = wmi_query_block(guid, instance, &output);
+ if (ACPI_FAILURE(status)) {
+ error = -EIO;
+ goto out_free_unlock;
+ }
obj = output.pointer;