summaryrefslogtreecommitdiffstats
path: root/drivers/mfd/tps65910.c
diff options
context:
space:
mode:
authorJesper Juhl <jj@chaosbits.net>2011-07-06 00:29:07 +0200
committerSamuel Ortiz <sameo@linux.intel.com>2011-07-31 23:28:26 +0200
commitdc7e412d431db5da7fa252f4c3ed475ef4af3e8a (patch)
treecd9e1779860c0a2820a4bc869f395176f19337a9 /drivers/mfd/tps65910.c
parentregulator: aat2870: Add AAT2870 regulator driver (diff)
downloadlinux-dc7e412d431db5da7fa252f4c3ed475ef4af3e8a.tar.xz
linux-dc7e412d431db5da7fa252f4c3ed475ef4af3e8a.zip
mfd: Don't leak init_data in tps65910_i2c_probe
There are a couple of situations where we leak init_data in drivers/mfd/tps65910.c:tps65910_i2c_probe() - this patch should take care of them. Signed-off-by: Jesper Juhl <jj@chaosbits.net> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to '')
-rw-r--r--drivers/mfd/tps65910.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/mfd/tps65910.c b/drivers/mfd/tps65910.c
index 837f0e6fbf0e..0226cdea2b47 100644
--- a/drivers/mfd/tps65910.c
+++ b/drivers/mfd/tps65910.c
@@ -151,8 +151,10 @@ static int tps65910_i2c_probe(struct i2c_client *i2c,
init_data->irq_base = pmic_plat_data->irq;
tps65910 = kzalloc(sizeof(struct tps65910), GFP_KERNEL);
- if (tps65910 == NULL)
+ if (tps65910 == NULL) {
+ kfree(init_data);
return -ENOMEM;
+ }
i2c_set_clientdata(i2c, tps65910);
tps65910->dev = &i2c->dev;
@@ -174,11 +176,13 @@ static int tps65910_i2c_probe(struct i2c_client *i2c,
if (ret < 0)
goto err;
+ kfree(init_data);
return ret;
err:
mfd_remove_devices(tps65910->dev);
kfree(tps65910);
+ kfree(init_data);
return ret;
}