Skip to content

Commit 19c839a

Browse files
sebszymanskiandy-shev
authored andcommitted
gpiolib: acpi: initialize acpi_gpio_info struct
Since commit 7c010d4 ("gpiolib: acpi: Make sure we fill struct acpi_gpio_info"), uninitialized acpi_gpio_info struct are passed to __acpi_find_gpio() and later in the call stack info->quirks is used in acpi_populate_gpio_lookup. This breaks the i2c_hid_cpi driver: [ 58.122916] i2c_hid_acpi i2c-UNIW0001:00: HID over i2c has not been provided an Int IRQ [ 58.123097] i2c_hid_acpi i2c-UNIW0001:00: probe with driver i2c_hid_acpi failed with error -22 Fix this by initializing the acpi_gpio_info pass to __acpi_find_gpio() Closes: https://bugzilla.kernel.org/show_bug.cgi?id=220388 Fixes: 7c010d4 ("gpiolib: acpi: Make sure we fill struct acpi_gpio_info") Signed-off-by: Sébastien Szymanski <sebastien.szymanski@armadeus.com> Tested-by: Hans de Goede <hansg@kernel.org> Reviewed-by: Hans de Goede <hansg@kernel.org> Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com> Tested-By: Calvin Owens <calvin@wbinvd.org> Cc: stable@vger.kernel.org Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
1 parent 3712ce9 commit 19c839a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/gpio/gpiolib-acpi-core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -942,7 +942,7 @@ struct gpio_desc *acpi_find_gpio(struct fwnode_handle *fwnode,
942942
{
943943
struct acpi_device *adev = to_acpi_device_node(fwnode);
944944
bool can_fallback = acpi_can_fallback_to_crs(adev, con_id);
945-
struct acpi_gpio_info info;
945+
struct acpi_gpio_info info = {};
946946
struct gpio_desc *desc;
947947
int ret;
948948

@@ -999,7 +999,7 @@ int acpi_dev_gpio_irq_wake_get_by(struct acpi_device *adev, const char *con_id,
999999
int ret;
10001000

10011001
for (i = 0, idx = 0; idx <= index; i++) {
1002-
struct acpi_gpio_info info;
1002+
struct acpi_gpio_info info = {};
10031003
struct gpio_desc *desc;
10041004

10051005
/* Ignore -EPROBE_DEFER, it only matters if idx matches */

0 commit comments

Comments
 (0)