Commit e7a7f972 authored by Alexandre Belloni's avatar Alexandre Belloni Committed by Linus Walleij

gpio: pca953x: fix irq_domain_add_simple usage

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
0e8f2fda (gpio: pca953x: use simple
irqdomain)
Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@free-electrons.com>
Acked-by: default avatarMaxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 31880c37
...@@ -575,7 +575,7 @@ static int pca953x_irq_setup(struct pca953x_chip *chip, ...@@ -575,7 +575,7 @@ static int pca953x_irq_setup(struct pca953x_chip *chip,
chip->gpio_chip.ngpio, chip->gpio_chip.ngpio,
irq_base, irq_base,
&pca953x_irq_simple_ops, &pca953x_irq_simple_ops,
NULL); chip);
if (!chip->domain) if (!chip->domain)
return -ENODEV; return -ENODEV;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment