• Michael Stickel's avatar
    gpio: mcp23s08: fixed count variable for devicetree probing · 3e3bed91
    Michael Stickel authored
    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: default avatarMichael Stickel <ms@mycable.de>
    Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
    3e3bed91
gpio-mcp23s08.c 24.3 KB