OSDN Git Service

pinctrl: mediatek: Fix some off by one bugs
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 18 Feb 2020 05:52:47 +0000 (08:52 +0300)
committerLinus Walleij <linus.walleij@linaro.org>
Fri, 21 Feb 2020 16:11:40 +0000 (17:11 +0100)
commit3385ab72d995fc0b876818a36203bf2429445686
treea6ea30ff903e0161900d9043a667ca49293cca83
parentd6d43a92172085a2681e06a0d06aac53c7bcdd12
pinctrl: mediatek: Fix some off by one bugs

These comparisons should be >= instead of > to prevent accessing one
element beyond the end of the hw->soc->pins[] array.

Fixes: 3de7deefce69 ("pinctrl: mediatek: Check gpio pin number and use binary search in mtk_hw_pin_field_lookup()")
Fixes: 184d8e13f9b1 ("pinctrl: mediatek: Add support for pin configuration dump via debugfs.")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20200218055247.74s2xa7veqx2do34@kili.mountain
Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/mediatek/pinctrl-paris.c