2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2025-01-09 06:04:05 +08:00

platform/x86: intel_skl_int3472: Uninitialized variable in skl_int3472_handle_gpio_resources()

This function returns negative error codes, zero (to indicate that
everything has been completed successfully) and one (to indicate that
more resources need to be handled still).

This code prints an uninitialized error message when the function
returns one which potentially leads to an Oops.

Fixes: 5de691bffe ("platform/x86: Add intel_skl_int3472 driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Daniel Scally <djrscally@gmail.com>
Link: https://lore.kernel.org/r/YNXTkLNtiTDlFlZa@mwanda
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
This commit is contained in:
Dan Carpenter 2021-06-25 16:01:04 +03:00 committed by Hans de Goede
parent 23dcd7497c
commit caf23895ce

View File

@ -286,10 +286,10 @@ static int skl_int3472_handle_gpio_resources(struct acpi_resource *ares,
int3472->ngpios++;
ACPI_FREE(obj);
if (ret)
if (ret < 0)
return dev_err_probe(int3472->dev, ret, err_msg);
return 0;
return ret;
}
static int skl_int3472_parse_crs(struct int3472_discrete_device *int3472)