]> git.baikalelectronics.ru Git - kernel.git/commit
gpio: davinci: Fix possible NULL pointer deference
authorNicholas Krause <xerofoify@gmail.com>
Wed, 3 Feb 2016 00:17:59 +0000 (19:17 -0500)
committerLinus Walleij <linus.walleij@linaro.org>
Mon, 15 Feb 2016 23:20:04 +0000 (00:20 +0100)
commitfd6abc5f260ffa1cd836df26a484b272b5ba84e3
treef902445297048e99dcf39e813db6fc4ae40699a7
parent84e4d4f9c1f3e78576819cb86bdeeb7df853a82f
gpio: davinci: Fix possible NULL pointer deference

This fixes a possible NULL pointer deference in the function,
davinci_gpio_probe due to the function, gpio2regs being able
to return a NULL pointer if it rans to get the registers for
the gpio devices on a davinci board. Furthermore if this does
arise return -ENXIO to signal callers that this case has arisen
and avoiding setting the regs or other pointer values on the

Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpio-davinci.c