Convert the sa11x0 socket driver memory allocation to use devm_kzalloc()
to simplify the cleanup path.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
for (i = 0; i < sinfo->nskt; i++)
soc_pcmcia_remove_one(&sinfo->skt[i]);
- kfree(sinfo);
return 0;
}
sa11xx_drv_pcmcia_ops(ops);
- sinfo = kzalloc(SKT_DEV_INFO_SIZE(nr), GFP_KERNEL);
+ sinfo = devm_kzalloc(dev, SKT_DEV_INFO_SIZE(nr), GFP_KERNEL);
if (!sinfo)
return -ENOMEM;
if (ret) {
while (--i >= 0)
soc_pcmcia_remove_one(&sinfo->skt[i]);
- kfree(sinfo);
} else {
dev_set_drvdata(dev, sinfo);
}