提交 33b6cb58 编写于 作者: C Colin Ian King 提交者: Linus Walleij

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: a60eac32 ("pinctrl: intel: Allow custom GPIO base for pad groups")
Signed-off-by: NColin Ian King <colin.king@canonical.com>
Acked-by: NMika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
上级 ad63da85
...@@ -1083,7 +1083,7 @@ static struct irq_chip intel_gpio_irqchip = { ...@@ -1083,7 +1083,7 @@ static struct irq_chip intel_gpio_irqchip = {
static int intel_gpio_add_pin_ranges(struct intel_pinctrl *pctrl, static int intel_gpio_add_pin_ranges(struct intel_pinctrl *pctrl,
const struct intel_community *community) const struct intel_community *community)
{ {
int ret, i; int ret = 0, i;
for (i = 0; i < community->ngpps; i++) { for (i = 0; i < community->ngpps; i++) {
const struct intel_padgroup *gpp = &community->gpps[i]; const struct intel_padgroup *gpp = &community->gpps[i];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册