diff options
author | Colin Ian King <colin.king@canonical.com> | 2015-04-20 11:59:17 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2015-05-04 09:20:22 -0400 |
commit | 74d77e50f23123938fbb7987eba71310864e6a7c (patch) | |
tree | e6fedf5ff64a30738f5b6daf008ec2bf451e29ef | |
parent | 4e637ac212b63f4b5dd1da626aca34ffcbfd5daa (diff) |
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>
-rw-r--r-- | drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c index 493294c0ebe6..474812e2b0cb 100644 --- a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c +++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c | |||
@@ -881,6 +881,8 @@ static int mtk_gpio_set_debounce(struct gpio_chip *chip, unsigned offset, | |||
881 | if (!mtk_eint_get_mask(pctl, eint_num)) { | 881 | if (!mtk_eint_get_mask(pctl, eint_num)) { |
882 | mtk_eint_mask(d); | 882 | mtk_eint_mask(d); |
883 | unmask = 1; | 883 | unmask = 1; |
884 | } else { | ||
885 | unmask = 0; | ||
884 | } | 886 | } |
885 | 887 | ||
886 | clr_bit = 0xff << eint_offset; | 888 | clr_bit = 0xff << eint_offset; |