aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDing Xiang <[email protected]>2018-09-06 12:19:19 +0800
committerPaul Burton <[email protected]>2018-09-06 14:12:35 -0700
commitc6e1241a82e6e74d1ae5cc34581dab2ffd6022d0 (patch)
tree5b62c8a72d6b652f759ed8e9fe751fb4fe034019
parent7c45885ea92972e7909847c39bd1698b76dffd73 (diff)
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 <[email protected]> Reviewed-by: Atsushi Nemoto <[email protected]> Signed-off-by: Paul Burton <[email protected]> Patchwork: https://patchwork.linux-mips.org/patch/20476/ Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected]
-rw-r--r--arch/mips/txx9/generic/setup.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/arch/mips/txx9/generic/setup.c b/arch/mips/txx9/generic/setup.c
index f6d9182ef82a..70a1ab66d252 100644
--- a/arch/mips/txx9/generic/setup.c
+++ b/arch/mips/txx9/generic/setup.c
@@ -960,12 +960,11 @@ void __init txx9_sramc_init(struct resource *r)
goto exit_put;
err = sysfs_create_bin_file(&dev->dev.kobj, &dev->bindata_attr);
if (err) {
- device_unregister(&dev->dev);
iounmap(dev->base);
- kfree(dev);
+ device_unregister(&dev->dev);
}
return;
exit_put:
+ iounmap(dev->base);
put_device(&dev->dev);
- return;
}