Skip to content

Commit

Permalink
gpiolib: acpi: Add missing memset(0) to acpi_get_gpiod_from_data()
Browse files Browse the repository at this point in the history
When refactoring the acpi_get_gpiod_from_data() the change missed
cleaning up the variable on stack. Add missing memset().

Reported-by: Ferry Toth <ftoth@exalondelft.nl>
Fixes: 16ba046 ("gpiolib: acpi: teach acpi_find_gpio() to handle data-only nodes")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
  • Loading branch information
Andy Shevchenko authored and Bartosz Golaszewski committed Oct 20, 2023
1 parent fc36341 commit 479ac41
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/gpio/gpiolib-acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -951,6 +951,7 @@ static struct gpio_desc *acpi_get_gpiod_from_data(struct fwnode_handle *fwnode,
if (!propname)
return ERR_PTR(-EINVAL);

memset(&lookup, 0, sizeof(lookup));
lookup.index = index;

ret = acpi_gpio_property_lookup(fwnode, propname, index, &lookup);
Expand Down

0 comments on commit 479ac41

Please sign in to comment.