* [PATCH] ACPI: fan: Bail out if extract package failed
@ 2022-11-22 8:53 Hanjun Guo
2022-11-23 18:33 ` Rafael J. Wysocki
0 siblings, 1 reply; 2+ messages in thread
From: Hanjun Guo @ 2022-11-22 8:53 UTC (permalink / raw)
To: Rafael J. Wysocki; +Cc: linux-acpi, Srinivas Pandruvada, 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")
Signed-off-by: Hanjun Guo <guohanjun@huawei.com>
---
drivers/acpi/fan_core.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/acpi/fan_core.c b/drivers/acpi/fan_core.c
index 52a0b30..9dccbae 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];
--
1.7.12.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ACPI: fan: Bail out if extract package failed
2022-11-22 8:53 [PATCH] ACPI: fan: Bail out if extract package failed Hanjun Guo
@ 2022-11-23 18:33 ` Rafael J. Wysocki
0 siblings, 0 replies; 2+ messages in thread
From: Rafael J. Wysocki @ 2022-11-23 18:33 UTC (permalink / raw)
To: Hanjun Guo; +Cc: Rafael J. Wysocki, linux-acpi, Srinivas Pandruvada
On Tue, Nov 22, 2022 at 10:08 AM Hanjun Guo <guohanjun@huawei.com> wrote:
>
> 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>
> ---
> drivers/acpi/fan_core.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/acpi/fan_core.c b/drivers/acpi/fan_core.c
> index 52a0b30..9dccbae 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];
> --
Applied as 6.2 material, thanks!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-11-23 18:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-22 8:53 [PATCH] ACPI: fan: Bail out if extract package failed Hanjun Guo
2022-11-23 18:33 ` Rafael J. Wysocki
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.