]> git.baikalelectronics.ru Git - kernel.git/commit
gpio: mcp23s08: fixed count variable for devicetree probing
authorMichael Stickel <ms@mycable.de>
Mon, 26 May 2014 08:03:16 +0000 (10:03 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Tue, 27 May 2014 13:50:57 +0000 (15:50 +0200)
commit86ba0df213d82d40bc2ede236867c9ec01538da2
tree875487e1e3fae9917c72b375456019e118a9b82a
parentd852b9e356145d98571f750b18e3910d7f0c698d
gpio: mcp23s08: fixed count variable for devicetree probing

Fixed missing increase of count variable for devicetree path in driver
probing.

The gpio-mcp23s08 driver has two paths for getting the platform
registration information. One for the classic platform initialization
and one for openfirmware devicetree based initialization. The devicetree
based path is missing the increase of the count variable, which results
in the count variable to become negative in the later use, where it is
decreased. The count variable is used as an index into a vector. This
results in accessing invalid memory space and can result in an exception.

Tested this with an AM3352 SoC with two mcp23s17 on two chip selects as
well as on a shared chip select.

Signed-off-by: Michael Stickel <ms@mycable.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpio-mcp23s08.c