Skip to contentSkip to conversation

pwm: omap-dmtimer: Potential NULL dereference on error

PATCH In review Dan Carpenter 2 participants 2 messages Dec 21, 2015 – Jan 4, 2016

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

PATCH 1/1 pwm: omap-dmtimer: Potential NULL dereference on error

"omap" is NULL so we can't dereference it.

---
It's weird that request_by_node() and free() are allocate/free pairs. Also this was Thierry's last minute tweaks mentioned in the changelog, Neil Armstrong is innocent. :P

drivers/pwm/pwm-omap-dmtimer.c +1 -1
index c453b33..826634e 100644
@@ -243,7 +243,7 @@ static int pwm_omap_dmtimer_probe(struct platform_device *pdev)
 
 	omap = devm_kzalloc(&pdev->dev, sizeof(*omap), GFP_KERNEL);
 	if (!omap) {
-		omap->pdata->free(dm_timer);
+		pdata->free(dm_timer);
 		return -ENOMEM;
 	}
 
#1 lore raw
Quoted 7 lines · Dan Carpenter

"omap" is NULL so we can't dereference it.

---
It's weird that request_by_node() and free() are allocate/free pairs. Also this was Thierry's last minute tweaks mentioned in the changelog, Neil Armstrong is innocent. :P

Applie, thanks.

Thierry