Skip to contentSkip to conversation

ACPI: fan: Bail out if extract package failed

PATCH Applied Hanjun Guo 2 participants 2 messages Nov 22, 2022 – Nov 23, 2022 ACPI

lore
Share & tools
lore

Hanjun Guo

author
#0 lore raw

PATCH 1/1 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")

---
 drivers/acpi/fan_core.c | 1 +
 1 file changed, 1 insertion(+)
drivers/acpi/fan_core.c +1 -0
index 52a0b30..9dccbae 100644
@@ -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];
Signature · 1 line
1.7.12.4
maintainer Applied
#1 lore raw
Quoted 16 lines · Hanjun Guo

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")

---
 drivers/acpi/fan_core.c | 1 +
 1 file changed, 1 insertion(+)
drivers/acpi/fan_core.c +0 -0
index 52a0b30..9dccbae 100644

drivers/acpi/fan_core.c static int acpi_fan_get_fif(struct acpi_device *device)

Quoted 8 lines
drivers/acpi/fan_core.c +1 -1
@@ -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];
--

Applied as 6.2 material, thanks!