* [PATCH][V2] pinctrl: mediatek: mtk-common: initialize unmask
@ 2015-04-20 15:59 Colin King
2015-05-04 13:20 ` Linus Walleij
0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2015-04-20 15:59 UTC (permalink / raw)
To: linux-arm-kernel
From: Colin Ian King <colin.king@canonical.com>
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>
---
drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
index 493294c..474812e 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,
if (!mtk_eint_get_mask(pctl, eint_num)) {
mtk_eint_mask(d);
unmask = 1;
+ } else {
+ unmask = 0;
}
clr_bit = 0xff << eint_offset;
--
2.1.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH][V2] pinctrl: mediatek: mtk-common: initialize unmask
2015-04-20 15:59 [PATCH][V2] pinctrl: mediatek: mtk-common: initialize unmask Colin King
@ 2015-05-04 13:20 ` Linus Walleij
0 siblings, 0 replies; 2+ messages in thread
From: Linus Walleij @ 2015-05-04 13:20 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Apr 20, 2015 at 5:59 PM, Colin King <colin.king@canonical.com> wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> 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>
Patch applied for fixes.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-05-04 13:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-20 15:59 [PATCH][V2] pinctrl: mediatek: mtk-common: initialize unmask Colin King
2015-05-04 13:20 ` Linus Walleij
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).