mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-18 22:14:16 +00:00
mips: txx9: fix iounmap related issue
if device_register return error, iounmap should be called, also iounmap need to call before put_device. Signed-off-by: Ding Xiang <dingxiang@cmss.chinamobile.com> Reviewed-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp> Signed-off-by: Paul Burton <paul.burton@mips.com> Patchwork: https://patchwork.linux-mips.org/patch/20476/ Cc: ralf@linux-mips.org Cc: jhogan@kernel.org Cc: linux-mips@linux-mips.org Cc: linux-kernel@vger.kernel.org
This commit is contained in:
parent
7c45885ea9
commit
c6e1241a82
1 changed files with 2 additions and 3 deletions
|
@ -960,12 +960,11 @@ void __init txx9_sramc_init(struct resource *r)
|
||||||
goto exit_put;
|
goto exit_put;
|
||||||
err = sysfs_create_bin_file(&dev->dev.kobj, &dev->bindata_attr);
|
err = sysfs_create_bin_file(&dev->dev.kobj, &dev->bindata_attr);
|
||||||
if (err) {
|
if (err) {
|
||||||
device_unregister(&dev->dev);
|
|
||||||
iounmap(dev->base);
|
iounmap(dev->base);
|
||||||
kfree(dev);
|
device_unregister(&dev->dev);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
exit_put:
|
exit_put:
|
||||||
|
iounmap(dev->base);
|
||||||
put_device(&dev->dev);
|
put_device(&dev->dev);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue