summaryrefslogtreecommitdiff
path: root/drivers/gpio/gpio-sprd.c
diff options
context:
space:
mode:
authorTimur Tabi <timur@codeaurora.org>2018-03-29 21:29:12 +0300
committerLinus Walleij <linus.walleij@linaro.org>2018-04-26 12:27:18 +0300
commitab3dbcf78f60f46d6a0ad63b1f4b690b7a427140 (patch)
tree54dc4dd788f1bed7ed77eec19ecb7cfd08daf6b8 /drivers/gpio/gpio-sprd.c
parentf241632fd087d3d9fbd5450f4d8c8604badd8348 (diff)
downloadlinux-ab3dbcf78f60f46d6a0ad63b1f4b690b7a427140.tar.xz
gpioib: do not free unrequested descriptors
If the main loop in linehandle_create() encounters an error, it unwinds completely by freeing all previously requested GPIO descriptors. However, if the error occurs in the beginning of the loop before that GPIO is requested, then the exit code attempts to free a null descriptor. If extrachecks is enabled, gpiod_free() triggers a WARN_ON. Instead, keep a separate count of legitimate GPIOs so that only those are freed. Cc: stable@vger.kernel.org Fixes: d7c51b47ac11 ("gpio: userspace ABI for reading/writing GPIO lines") Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: Timur Tabi <timur@codeaurora.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio/gpio-sprd.c')
0 files changed, 0 insertions, 0 deletions