mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 03:15:31 +09:00
gpio: syscon: Fix possible NULL ptr usage
[ Upstream commit 70728c2946 ]
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 <marex@denx.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
312de5a09d
commit
07ed61a0a7
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user