diff options
author | Bartosz Golaszewski <[email protected]> | 2024-02-14 09:44:19 +0100 |
---|---|---|
committer | Bartosz Golaszewski <[email protected]> | 2024-02-15 08:39:29 +0100 |
commit | 0d7fa0eda4e3ffe1b7ebc73b6ef81298bddda649 (patch) | |
tree | 36856d053c8c32ea85a5dd3689e0f901901dc6c5 /lib/test_fortify/write_overflow-strncpy-src.c | |
parent | d82b9e0887e69d9060c854b079a3a5024788f7cb (diff) |
gpio: don't let lockdep complain about inherently dangerous RCU usage
There are two legacy, deprecated functions - gpiod_to_chip() and
gpio_device_get_chip() - that still have users in tree. They return the
address of the SRCU-protected chip outside of the read-only critical
sections. They are inherently dangerous and the users should convert to
safer alternatives. Let's explicitly silence lockdep warnings by using
rcu_dereference_check(ptr, 1). While at it: reuse
gpio_device_get_chip() in gpiod_to_chip().
Fixes: d83cee3d2bb1 ("gpio: protect the pointer to gpio_chip in gpio_device with SRCU")
Reported-by: kernel test robot <[email protected]>
Closes: https://lore.kernel.org/oe-lkp/[email protected]
Signed-off-by: Bartosz Golaszewski <[email protected]>
Diffstat (limited to 'lib/test_fortify/write_overflow-strncpy-src.c')
0 files changed, 0 insertions, 0 deletions