diff options
| author | Bartosz Golaszewski <[email protected]> | 2024-10-24 13:38:34 +0000 |
|---|---|---|
| committer | Bartosz Golaszewski <[email protected]> | 2024-10-24 18:51:09 +0000 |
| commit | 1f4a640e9ac7f450752365541ad9c064b13ef8bf (patch) | |
| tree | 23fe36bb0548066e513d8a047bf1e3dacf874efe /lib/crypto/mpi/mpi-mul.c | |
| parent | gpio: mb86s7x: remove some dead code in mb86s70_gpio_to_irq() (diff) | |
| download | kernel-1f4a640e9ac7f450752365541ad9c064b13ef8bf.tar.gz kernel-1f4a640e9ac7f450752365541ad9c064b13ef8bf.zip | |
gpiolib: fix a NULL-pointer dereference when setting direction
For optional GPIOs we may pass NULL to gpiod_direction_(input|output)().
With the call to the notifier chain added by commit 07c61d4da43f
("gpiolib: notify user-space about in-kernel line state changes") we
will now dereference a NULL pointer in this case. The reason for that is
the fact that the expansion of the VALIDATE_DESC() macro (which returns
0 for NULL descriptors) was moved into the nonotify variants of the
direction setters.
Move them back to the top-level interfaces as the nonotify ones are only
ever called from inside the GPIO core and are always passed valid GPIO
descriptors. This way we'll never call the line_state notifier chain
with non-valid descs.
Fixes: 07c61d4da43f ("gpiolib: notify user-space about in-kernel line state changes")
Reported-by: Mark Brown <[email protected]>
Closes: https://lore.kernel.org/all/[email protected]/
Tested-by: Klara Modin <[email protected]>
Tested-by: Mark Brown <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Bartosz Golaszewski <[email protected]>
Diffstat (limited to 'lib/crypto/mpi/mpi-mul.c')
0 files changed, 0 insertions, 0 deletions
