mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-29 23:53:32 +00:00
i2c: i801: Fix the i2c-mux gpiod_lookup_table not being properly terminated
commit0b3ea2a06d
upstream. gpiod_add_lookup_table() expects the gpiod_lookup_table->table passed to it to be terminated with a zero-ed out entry. So we need to allocate one more entry then we will use. Fixes:d308dfbf62
("i2c: mux/i801: Switch to use descriptor passing") Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com> Acked-by: Jean Delvare <jdelvare@suse.de> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Wolfram Sang <wsa@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
12e8bcaef6
commit
55503711ad
1 changed files with 1 additions and 1 deletions
|
@ -1424,7 +1424,7 @@ static int i801_add_mux(struct i801_priv *priv)
|
|||
|
||||
/* Register GPIO descriptor lookup table */
|
||||
lookup = devm_kzalloc(dev,
|
||||
struct_size(lookup, table, mux_config->n_gpios),
|
||||
struct_size(lookup, table, mux_config->n_gpios + 1),
|
||||
GFP_KERNEL);
|
||||
if (!lookup)
|
||||
return -ENOMEM;
|
||||
|
|
Loading…
Reference in a new issue