diff options
| author | Bartosz Golaszewski <[email protected]> | 2025-06-18 13:02:07 +0000 |
|---|---|---|
| committer | Bartosz Golaszewski <[email protected]> | 2025-06-19 07:13:44 +0000 |
| commit | cbb887a76b788d8e9646fdd785f43745a3a662bb (patch) | |
| tree | bd3bbd05ab9f66fb027e0604ada83d07425e83da | |
| parent | gpio: npcm-sgpio: don't use legacy GPIO chip setters (diff) | |
| download | kernel-cbb887a76b788d8e9646fdd785f43745a3a662bb.tar.gz kernel-cbb887a76b788d8e9646fdd785f43745a3a662bb.zip | |
gpio: mmio: don't use legacy GPIO chip setters
We've converted this driver to using the new GPIO line value setters but
missed the instances where the legacy callback is accessed directly using
the function pointer. This will lead to a NULL-pointer dereference as
this pointer is no longer populated. The issue needs fixing locally as
well as in the already converted previously users of gpio-mmio.
Fixes: b908d35d0003 ("gpio: mmio: use new GPIO line value setter callbacks")
Reported-by: Klara Modin <[email protected]>
Closes: https://lore.kernel.org/all/2rw2sncevdiyirpdovotztlg77apcq2btzytuv5jnm55aqhlne@swtts3hl53tw/
Tested-by: Klara Modin <[email protected]>
Tested-by: Marek Szyprowski <[email protected]>
Tested-by: Mark Brown <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Bartosz Golaszewski <[email protected]>
| -rw-r--r-- | drivers/gpio/gpio-74xx-mmio.c | 2 | ||||
| -rw-r--r-- | drivers/gpio/gpio-en7523.c | 2 | ||||
| -rw-r--r-- | drivers/gpio/gpio-mmio.c | 6 |
3 files changed, 5 insertions, 5 deletions
diff --git a/drivers/gpio/gpio-74xx-mmio.c b/drivers/gpio/gpio-74xx-mmio.c index c7ac5a9ffb1f..3ba21add3a1c 100644 --- a/drivers/gpio/gpio-74xx-mmio.c +++ b/drivers/gpio/gpio-74xx-mmio.c @@ -100,7 +100,7 @@ static int mmio_74xx_dir_out(struct gpio_chip *gc, unsigned int gpio, int val) struct mmio_74xx_gpio_priv *priv = gpiochip_get_data(gc); if (priv->flags & MMIO_74XX_DIR_OUT) { - gc->set(gc, gpio, val); + gc->set_rv(gc, gpio, val); return 0; } diff --git a/drivers/gpio/gpio-en7523.c b/drivers/gpio/gpio-en7523.c index 69834db2c1cf..c08069d0d104 100644 --- a/drivers/gpio/gpio-en7523.c +++ b/drivers/gpio/gpio-en7523.c @@ -50,7 +50,7 @@ static int airoha_dir_set(struct gpio_chip *gc, unsigned int gpio, iowrite32(dir, ctrl->dir[gpio / 16]); if (out) - gc->set(gc, gpio, val); + gc->set_rv(gc, gpio, val); iowrite32(output, ctrl->output); diff --git a/drivers/gpio/gpio-mmio.c b/drivers/gpio/gpio-mmio.c index 4d999f358cc4..08466e123818 100644 --- a/drivers/gpio/gpio-mmio.c +++ b/drivers/gpio/gpio-mmio.c @@ -367,7 +367,7 @@ static int bgpio_dir_out_err(struct gpio_chip *gc, unsigned int gpio, static int bgpio_simple_dir_out(struct gpio_chip *gc, unsigned int gpio, int val) { - gc->set(gc, gpio, val); + gc->set_rv(gc, gpio, val); return bgpio_dir_return(gc, gpio, true); } @@ -432,14 +432,14 @@ static int bgpio_dir_out_dir_first(struct gpio_chip *gc, unsigned int gpio, int val) { bgpio_dir_out(gc, gpio, val); - gc->set(gc, gpio, val); + gc->set_rv(gc, gpio, val); return bgpio_dir_return(gc, gpio, true); } static int bgpio_dir_out_val_first(struct gpio_chip *gc, unsigned int gpio, int val) { - gc->set(gc, gpio, val); + gc->set_rv(gc, gpio, val); bgpio_dir_out(gc, gpio, val); return bgpio_dir_return(gc, gpio, true); } |
