gpio: wcd934x: Fix shift-out-of-bounds error
authorSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Tue, 25 May 2021 16:55:39 +0000 (17:55 +0100)
committerBartosz Golaszewski <bgolaszewski@baylibre.com>
Thu, 27 May 2021 07:51:35 +0000 (09:51 +0200)
commitdbec64b11c65d74f31427e2b9d5746fbf17bf840
treed0089600fb919150a09375efceea53bf1b96cb78
parentbdbe871ef0caa660e16461a2a94579d9f9ef7ba4
gpio: wcd934x: Fix shift-out-of-bounds error

bit-mask for pins 0 to 4 is BIT(0) to BIT(4) however we ended up with BIT(n - 1)
which is not right, and this was caught by below usban check

UBSAN: shift-out-of-bounds in drivers/gpio/gpio-wcd934x.c:34:14

Fixes: 59c324683400 ("gpio: wcd934x: Add support to wcd934x gpio controller")
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
drivers/gpio/gpio-wcd934x.c