]> git.baikalelectronics.ru Git - kernel.git/commit
mfd: tps65911-comparator: Fix an off by one bug
authorLee Jones <lee.jones@linaro.org>
Tue, 1 May 2018 09:26:59 +0000 (10:26 +0100)
committerLee Jones <lee.jones@linaro.org>
Wed, 16 May 2018 08:21:48 +0000 (09:21 +0100)
commit4f5dd7f0bb375f18051481e88fad6c22d7f5b77b
tree9a3634003cdc0672e4874f04078e21bf836cdae3
parent658b44a31decc54340ede1ca9c116f65814e9809
mfd: tps65911-comparator: Fix an off by one bug

The COMP1 and COMP2 elements are in 0 and 1 respectively so this code is
accessing the wrong elements and one space beyond the end of the array.

The "id" variable is never COMP (0) so that code can be removed.

Fixes: 2b167c5cb58e ("TPS65911: Comparator: Add comparator driver")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/mfd/tps65911-comparator.c