]> git.baikalelectronics.ru Git - kernel.git/commit
gpio: 104-dio-48e: Fix control port offset computation off-by-one error
authorWilliam Breathitt Gray <vilhelm.gray@gmail.com>
Thu, 2 Jun 2016 20:00:09 +0000 (16:00 -0400)
committerLinus Walleij <linus.walleij@linaro.org>
Wed, 8 Jun 2016 08:08:12 +0000 (10:08 +0200)
commitb1abc4af2f2cc652867c983bef9a59973672a3da
tree292389e5b2bc098989c727326858132af43450b0
parent419badeadc49eff8fd78eaffc49ff72773cbd9de
gpio: 104-dio-48e: Fix control port offset computation off-by-one error

There are only two control ports, each controlling three distinct I/O
ports. To compute the control port address offset for a respective I/O
port, the I/O port address offset should be divided by 3; dividing by 2
may result in not only the wrong address offset but possibly also an
out-of-bounds array memory access for a non-existent third control port.

Fixes: ef229c466254 ("gpio: Add GPIO support for the ACCES 104-DIO-48E")
Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpio-104-dio-48e.c