Skip to content

Commit

Permalink
gpio: pca953x: fix irq_domain_add_simple usage
Browse files Browse the repository at this point in the history
We actually have to pass chip as the host_data parameter of
irq_domain_add_simple() as later on, it is used to initialize chip_data
in pca953x_gpio_irq_map(). Failing to do so is leading to a NULL pointer
dereference after calling irq_data_get_irq_chip_data() in
pca953x_irq_mask(), pca953x_irq_unmask(), pca953x_irq_bus_lock(),
pca953x_irq_bus_sync_unlock() and pca953x_irq_set_type().

Fixes regression introduced by commit
0e8f2fd (gpio: pca953x: use simple
irqdomain)

Signed-off-by: Alexandre Belloni <[email protected]>
Acked-by: Maxime Ripard <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
  • Loading branch information
alexandrebelloni authored and linusw committed Apr 11, 2013
1 parent 31880c3 commit e7a7f97
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpio/gpio-pca953x.c
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ static int pca953x_irq_setup(struct pca953x_chip *chip,
chip->gpio_chip.ngpio,
irq_base,
&pca953x_irq_simple_ops,
NULL);
chip);
if (!chip->domain)
return -ENODEV;

Expand Down

0 comments on commit e7a7f97

Please sign in to comment.