summaryrefslogtreecommitdiff
path: root/drivers/pinctrl
diff options
context:
space:
mode:
authorColin Ian King <colin.king@canonical.com>2017-12-04 20:08:15 +0300
committerLinus Walleij <linus.walleij@linaro.org>2017-12-07 11:59:39 +0300
commit33b6cb58cbb6c872ebf874d8017c27aaa2130928 (patch)
tree4f8565eec65665f69f9a6ee3339a2476459da6af /drivers/pinctrl
parentad63da85f45fa55c270e5681e9b985605ec51f8d (diff)
downloadlinux-33b6cb58cbb6c872ebf874d8017c27aaa2130928.tar.xz
pinctrl: intel: ensure error return ret is initialized
In the (unlikely) event that community->ngpps is zero, or if every gpp->gpio_base is less than zero, then an ininitialized value in ret is returned by function intel_gpio_add_pin_ranges. Fix this by ensuring ret is initialized to zero. It's a moot point, but I think it is worthwhile ensuring this corner case is fixed. Detected by CoverityScan, CID#1462415 ("Uninitialized scalar variable") Fixes: a60eac3239f0 ("pinctrl: intel: Allow custom GPIO base for pad groups") Signed-off-by: Colin Ian King <colin.king@canonical.com> Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl')
-rw-r--r--drivers/pinctrl/intel/pinctrl-intel.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/pinctrl/intel/pinctrl-intel.c b/drivers/pinctrl/intel/pinctrl-intel.c
index 359800fcb951..96e73e30204e 100644
--- a/drivers/pinctrl/intel/pinctrl-intel.c
+++ b/drivers/pinctrl/intel/pinctrl-intel.c
@@ -1083,7 +1083,7 @@ static struct irq_chip intel_gpio_irqchip = {
static int intel_gpio_add_pin_ranges(struct intel_pinctrl *pctrl,
const struct intel_community *community)
{
- int ret, i;
+ int ret = 0, i;
for (i = 0; i < community->ngpps; i++) {
const struct intel_padgroup *gpp = &community->gpps[i];