diff options
| author | Marek Vasut <[email protected]> | 2018-10-03 22:52:52 +0000 |
|---|---|---|
| committer | Linus Walleij <[email protected]> | 2018-10-10 08:33:11 +0000 |
| commit | 70728c29465bc4bfa7a8c14304771eab77e923c7 (patch) | |
| tree | cb1500a167ef166b30292403a2a5780d2a32d25c /drivers/gpio/gpio-syscon.c | |
| parent | gpiolib: Show correct direction from the beginning (diff) | |
| download | kernel-70728c29465bc4bfa7a8c14304771eab77e923c7.tar.gz kernel-70728c29465bc4bfa7a8c14304771eab77e923c7.zip | |
gpio: syscon: Fix possible NULL ptr usage
The priv->data->set can be NULL while flags contains GPIO_SYSCON_FEAT_OUT
and chip->set is valid pointer. This happens in case the controller uses
the default GPIO setter. Always use chip->set to access the setter to avoid
possible NULL pointer dereferencing.
Signed-off-by: Marek Vasut <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
Diffstat (limited to 'drivers/gpio/gpio-syscon.c')
| -rw-r--r-- | drivers/gpio/gpio-syscon.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpio/gpio-syscon.c b/drivers/gpio/gpio-syscon.c index 87c18a544513..7f3da34c7874 100644 --- a/drivers/gpio/gpio-syscon.c +++ b/drivers/gpio/gpio-syscon.c @@ -122,7 +122,7 @@ static int syscon_gpio_dir_out(struct gpio_chip *chip, unsigned offset, int val) BIT(offs % SYSCON_REG_BITS)); } - priv->data->set(chip, offset, val); + chip->set(chip, offset, val); return 0; } |
