X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=drivers%2Facpi%2Fsysfs.c;h=4b3a9e27f1b611cd9d7b2c4b7268a214e0211b0c;hb=d65032ab06f457f831329a0241f70e4ff05bb23e;hp=0243d375c6fd40134bd7404008ef6e43144867dc;hpb=5ca9d3a4286a1a4aaa46acc7c1c29a15d8d0fea2;p=firefly-linux-kernel-4.4.55.git diff --git a/drivers/acpi/sysfs.c b/drivers/acpi/sysfs.c index 0243d375c6fd..4b3a9e27f1b6 100644 --- a/drivers/acpi/sysfs.c +++ b/drivers/acpi/sysfs.c @@ -555,23 +555,22 @@ static void acpi_global_event_handler(u32 event_type, acpi_handle device, static int get_status(u32 index, acpi_event_status *status, acpi_handle *handle) { - int result = 0; + int result; if (index >= num_gpes + ACPI_NUM_FIXED_EVENTS) - goto end; + return -EINVAL; if (index < num_gpes) { result = acpi_get_gpe_device(index, handle); if (result) { ACPI_EXCEPTION((AE_INFO, AE_NOT_FOUND, "Invalid GPE 0x%x", index)); - goto end; + return result; } result = acpi_get_gpe_status(*handle, index, status); } else if (index < (num_gpes + ACPI_NUM_FIXED_EVENTS)) result = acpi_get_event_status(index - num_gpes, status); -end: return result; }