aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd/tps65910.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mfd/tps65910.c')
-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,
151 init_data->irq_base = pmic_plat_data->irq; 151 init_data->irq_base = pmic_plat_data->irq;
152 152
153 tps65910 = kzalloc(sizeof(struct tps65910), GFP_KERNEL); 153 tps65910 = kzalloc(sizeof(struct tps65910), GFP_KERNEL);
154 if (tps65910 == NULL) 154 if (tps65910 == NULL) {
155 kfree(init_data);
155 return -ENOMEM; 156 return -ENOMEM;
157 }
156 158
157 i2c_set_clientdata(i2c, tps65910); 159 i2c_set_clientdata(i2c, tps65910);
158 tps65910->dev = &i2c->dev; 160 tps65910->dev = &i2c->dev;
@@ -174,11 +176,13 @@ static int tps65910_i2c_probe(struct i2c_client *i2c,
174 if (ret < 0) 176 if (ret < 0)
175 goto err; 177 goto err;
176 178
179 kfree(init_data);
177 return ret; 180 return ret;
178 181
179err: 182err:
180 mfd_remove_devices(tps65910->dev); 183 mfd_remove_devices(tps65910->dev);
181 kfree(tps65910); 184 kfree(tps65910);
185 kfree(init_data);
182 return ret; 186 return ret;
183} 187}
184 188