Skip to content

Commit 0b3ea2a

Browse files
jwrdegoedewsakernel
authored andcommitted
i2c: i801: Fix the i2c-mux gpiod_lookup_table not being properly terminated
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: d308dfb ("i2c: mux/i801: Switch to use descriptor passing") Signed-off-by: Hans de Goede <[email protected]> Reviewed-by: Mika Westerberg <[email protected]> Acked-by: Jean Delvare <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
1 parent 0b884fe commit 0b3ea2a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/i2c/busses/i2c-i801.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1449,7 +1449,7 @@ static int i801_add_mux(struct i801_priv *priv)
14491449

14501450
/* Register GPIO descriptor lookup table */
14511451
lookup = devm_kzalloc(dev,
1452-
struct_size(lookup, table, mux_config->n_gpios),
1452+
struct_size(lookup, table, mux_config->n_gpios + 1),
14531453
GFP_KERNEL);
14541454
if (!lookup)
14551455
return -ENOMEM;

0 commit comments

Comments
 (0)