Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 74d77e50 authored by Colin Ian King's avatar Colin Ian King Committed by Linus Walleij
Browse files

pinctrl: mediatek: mtk-common: initialize unmask



cppcheck detected an uninitialized variable:

[drivers/pinctrl/mediatek/pinctrl-mtk-common.c:897]:
  (error) Uninitialized variable: unmask

unmask should be initialized to zero to ensure unmasking
only occurs if a previous mask occurred. The current situation
is that the unmask variable could contain any random garbage
causing random unexpected unmasking.

Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 4e637ac2
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -881,6 +881,8 @@ static int mtk_gpio_set_debounce(struct gpio_chip *chip, unsigned offset,
	if (!mtk_eint_get_mask(pctl, eint_num)) {
		mtk_eint_mask(d);
		unmask = 1;
	} else {
		unmask = 0;
	}

	clr_bit = 0xff << eint_offset;