summaryrefslogtreecommitdiff
path: root/drivers/acpi
diff options
context:
space:
mode:
authorHanjun Guo <guohanjun@huawei.com>2022-11-22 11:53:28 +0300
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2022-11-23 21:31:57 +0300
commitf2ae44ae5335864794acb5b0490746ba9db3ccd7 (patch)
tree7d7b23585648532a5b08da76a60625c9ed8c1b2e /drivers/acpi
parenteb7081409f94a9a8608593d0fb63a1aa3d6f95d8 (diff)
downloadlinux-f2ae44ae5335864794acb5b0490746ba9db3ccd7.tar.xz
ACPI: fan: Bail out if extract package failed
Bail out if we extract the _FIF package failed, or we will end of referencing the garbage information in fields[], the fan control will be in mess, fix it. Fiexes: d445571fa369 ("ACPI: fan: Optimize struct acpi_fan_fif") Signed-off-by: Hanjun Guo <guohanjun@huawei.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/fan_core.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/acpi/fan_core.c b/drivers/acpi/fan_core.c
index 52a0b303b70a..9dccbae9e8ea 100644
--- a/drivers/acpi/fan_core.c
+++ b/drivers/acpi/fan_core.c
@@ -236,6 +236,7 @@ static int acpi_fan_get_fif(struct acpi_device *device)
if (ACPI_FAILURE(status)) {
dev_err(&device->dev, "Invalid _FIF element\n");
status = -EINVAL;
+ goto err;
}
fan->fif.revision = fields[0];