mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-06 08:46:46 +00:00
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: Colin Ian King <colin.king@canonical.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
parent
4e637ac212
commit
74d77e50f2
1 changed files with 2 additions and 0 deletions
|
@ -881,6 +881,8 @@ static int mtk_gpio_set_debounce(struct gpio_chip *chip, unsigned offset,
|
||||||
if (!mtk_eint_get_mask(pctl, eint_num)) {
|
if (!mtk_eint_get_mask(pctl, eint_num)) {
|
||||||
mtk_eint_mask(d);
|
mtk_eint_mask(d);
|
||||||
unmask = 1;
|
unmask = 1;
|
||||||
|
} else {
|
||||||
|
unmask = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
clr_bit = 0xff << eint_offset;
|
clr_bit = 0xff << eint_offset;
|
||||||
|
|
Loading…
Reference in a new issue