Skip to contentSkip to conversation

regulator: tps65910: Fix a memory leak in tps65910_probe error path

PATCH Applied Axel Lin 3 participants 3 messages Jul 10, 2011 – Jul 22, 2011

Subsystems (2)
lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 regulator: tps65910: Fix a memory leak in tps65910_probe error path

Fix a memory leak if chip id is not matched.

---
 drivers/regulator/tps65910-regulator.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/regulator/tps65910-regulator.c +1 -0
index fe8dc02..e15aac6 100644
@@ -909,6 +909,7 @@ static __devinit int tps65910_probe(struct platform_device *pdev)
 		break;
 	default:
 		pr_err("Invalid tps chip version\n");
+		kfree(pmic);
 		return -ENODEV;
 	}
 
Signature · 1 line
1.7.4.1
#2 lore raw
In reply to Axel Lin
Quoted 12 lines · Axel Lin

Fix a memory leak if chip id is not matched.

---
 drivers/regulator/tps65910-regulator.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/regulator/tps65910-regulator.c +0 -0
index fe8dc02..e15aac6 100644

drivers/regulator/tps65910-regulator.c static __devinit int tps65910_probe(struct platform_device *pdev) · line 915

Quoted 7 lines
drivers/regulator/tps65910-regulator.c +1 -0
@@ -909,6 +909,7 @@ static __devinit int tps65910_probe(struct platform_device *pdev)
 		break;
 	default:
 		pr_err("Invalid tps chip version\n");
+		kfree(pmic);
 		return -ENODEV;
 	}
 

Applied.

Thanks

Liam