aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/maps/pismo.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/maps/pismo.c')
-rw-r--r--drivers/mtd/maps/pismo.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/mtd/maps/pismo.c b/drivers/mtd/maps/pismo.c
index 60c068db452d..eb476b7f8d11 100644
--- a/drivers/mtd/maps/pismo.c
+++ b/drivers/mtd/maps/pismo.c
@@ -234,6 +234,7 @@ static int __devexit pismo_remove(struct i2c_client *client)
234 /* FIXME: set_vpp needs saner arguments */ 234 /* FIXME: set_vpp needs saner arguments */
235 pismo_setvpp_remove_fix(pismo); 235 pismo_setvpp_remove_fix(pismo);
236 236
237 i2c_set_clientdata(client, NULL);
237 kfree(pismo); 238 kfree(pismo);
238 239
239 return 0; 240 return 0;
@@ -272,7 +273,7 @@ static int __devinit pismo_probe(struct i2c_client *client,
272 ret = pismo_eeprom_read(client, &eeprom, 0, sizeof(eeprom)); 273 ret = pismo_eeprom_read(client, &eeprom, 0, sizeof(eeprom));
273 if (ret < 0) { 274 if (ret < 0) {
274 dev_err(&client->dev, "error reading EEPROM: %d\n", ret); 275 dev_err(&client->dev, "error reading EEPROM: %d\n", ret);
275 return ret; 276 goto exit_free;
276 } 277 }
277 278
278 dev_info(&client->dev, "%.15s board found\n", eeprom.board); 279 dev_info(&client->dev, "%.15s board found\n", eeprom.board);
@@ -283,6 +284,11 @@ static int __devinit pismo_probe(struct i2c_client *client,
283 pdata->cs_addrs[i]); 284 pdata->cs_addrs[i]);
284 285
285 return 0; 286 return 0;
287
288 exit_free:
289 i2c_set_clientdata(client, NULL);
290 kfree(pismo);
291 return ret;
286} 292}
287 293
288static const struct i2c_device_id pismo_id[] = { 294static const struct i2c_device_id pismo_id[] = {