Skip to content

Commit 21a9acc

Browse files
mudongliangbrgl
authored andcommitted
gpio: tqmx86: fix uninitialized variable girq
The commit 9246106 ("gpio: tpmx86: Move PM device over to irq domain") adds a dereference of girq that may be uninitialized. Fix this by moving irq_domain_set_pm_device into if true branch as suggested by Marc Zyngier. Fixes: 9246106 ("gpio: tpmx86: Move PM device over to irq domain") Suggested-by: Marc Zyngier <[email protected]> Signed-off-by: Dongliang Mu <[email protected]> Acked-by: Marc Zyngier <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
1 parent ab637d4 commit 21a9acc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/gpio/gpio-tqmx86.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,8 @@ static int tqmx86_gpio_probe(struct platform_device *pdev)
307307
girq->default_type = IRQ_TYPE_NONE;
308308
girq->handler = handle_simple_irq;
309309
girq->init_valid_mask = tqmx86_init_irq_valid_mask;
310+
311+
irq_domain_set_pm_device(girq->domain, dev);
310312
}
311313

312314
ret = devm_gpiochip_add_data(dev, chip, gpio);
@@ -315,8 +317,6 @@ static int tqmx86_gpio_probe(struct platform_device *pdev)
315317
goto out_pm_dis;
316318
}
317319

318-
irq_domain_set_pm_device(girq->domain, dev);
319-
320320
dev_info(dev, "GPIO functionality initialized with %d pins\n",
321321
chip->ngpio);
322322

0 commit comments

Comments
 (0)