Skip to content

Commit 7d3a5eb

Browse files
arndbMarc Zyngier
authored andcommitted
irqchip/imx-irqsteer: Fix of_property_read_u32() error handling
gcc points out that irqs_num is not initialized when of_property_read_u32() is an empty stub function: Included from drivers/irqchip/irq-imx-irqsteer.c:7: drivers/irqchip/irq-imx-irqsteer.c: In function 'imx_irqsteer_probe': include/uapi/linux/kernel.h:13:49: error: 'irqs_num' may be used uninitialized in this function [-Werror=maybe-uninitialized] The same can actually happen with CONFIG_OF=y as well, though we don't get a warning then. Add error checking here that lets the code deal with missing or invalid properties as well as avoid the warning. Fixes: 28528fc ("irqchip/imx-irqsteer: Add multi output interrupts support") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
1 parent 28528fc commit 7d3a5eb

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

drivers/irqchip/irq-imx-irqsteer.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,12 @@ static int imx_irqsteer_probe(struct platform_device *pdev)
169169

170170
raw_spin_lock_init(&data->lock);
171171

172-
of_property_read_u32(np, "fsl,num-irqs", &irqs_num);
173-
of_property_read_u32(np, "fsl,channel", &data->channel);
172+
ret = of_property_read_u32(np, "fsl,num-irqs", &irqs_num);
173+
if (ret)
174+
return ret;
175+
ret = of_property_read_u32(np, "fsl,channel", &data->channel);
176+
if (ret)
177+
return ret;
174178

175179
/*
176180
* There is one output irq for each group of 64 inputs.

0 commit comments

Comments
 (0)