Skip to contentSkip to conversation

ARM: pxa: pxa_cplds: signedness bug in probe

PATCH In review Dan Carpenter 2 participants 2 messages May 13, 2015

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: pxa: pxa_cplds: signedness bug in probe

"base_irq" needs to be signed for the error handling to work. Also we can remove the initialization because we re-assign it later.

Fixes aa8d6b73ea33 ('ARM: pxa: pxa_cplds: add lubbock and mainstone IO')
arch/arm/mach-pxa/pxa_cplds_irqs.c +1 -1
index f1aeb54..2385052 100644
@@ -107,7 +107,7 @@ static int cplds_probe(struct platform_device *pdev)
 	struct resource *res;
 	struct cplds *fpga;
 	int ret;
-	unsigned int base_irq = 0;
+	int base_irq;
 	unsigned long irqflags = 0;
 
 	fpga = devm_kzalloc(&pdev->dev, sizeof(*fpga), GFP_KERNEL);
maintainer
#1 lore raw
Quoted 2 lines · Dan Carpenter

"base_irq" needs to be signed for the error handling to work. Also we can remove the initialization because we re-assign it later.

Indeed.

I suppose smatch found this one with :
arch/arm/mach-pxa/pxa_cplds_irqs.c:126 cplds_probe() warn: unsigned 'base_irq' is never less than zero.
I still don't see which tool found the "re-assign" part ...

Anyway, thanks for this, I'll queue it in pxa/fixes.

Cheers.

--
Robert