summaryrefslogtreecommitdiff
path: root/kernel/gcov/gcov.h
diff options
context:
space:
mode:
authorDan Callaghan <dan.callaghan@opengear.com>2020-01-21 10:12:17 +1000
committerLinus Walleij <linus.walleij@linaro.org>2020-01-23 16:25:03 +0100
commit207270dd0b2d593a8b92043c9bcdabb42111fcc3 (patch)
tree1196d6684b765b0b2e8a3d17b02181174443393d /kernel/gcov/gcov.h
parent0d311d8b93cfc8ab36aa11f09e15a5fe87147c02 (diff)
gpiolib: hold gpio devices lock until ->descs array is initialised
If a driver consuming the GPIO chip is being probed at the same time as the GPIO driver is registering the chip, it is possible for the consuming driver to see the ->descs array in an uninitialised state. For example, the gpio-keys-polled driver can fail like this: kernel: gpiod_request: invalid GPIO (no device) kernel: gpio-keys-polled PRP0001:07: failed to get gpio: -22 kernel: gpio-keys-polled: probe of PRP0001:07 failed with error -22 This patch makes gpiochip_add() hold the lock protecting gpio_devices until it has finished setting desc->gdev on the newly inserted list entry. Signed-off-by: Dan Callaghan <dan.callaghan@opengear.com> Link: https://lore.kernel.org/r/20200121001216.15964-1-dan.callaghan@opengear.com Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'kernel/gcov/gcov.h')
0 files changed, 0 insertions, 0 deletions