[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1536207559-31543-1-git-send-email-dingxiang@cmss.chinamobile.com>
Date: Thu, 6 Sep 2018 12:19:19 +0800
From: Ding Xiang <dingxiang@...s.chinamobile.com>
To: ralf@...ux-mips.org, paul.burton@...s.com, jhogan@...nel.org,
linux-mips@...ux-mips.org, linux-kernel@...r.kernel.org
Cc: dingxiang@...s.chinamobile.com
Subject: [PATCH] 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@...s.chinamobile.com>
---
arch/mips/txx9/generic/setup.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/arch/mips/txx9/generic/setup.c b/arch/mips/txx9/generic/setup.c
index f6d9182..70a1ab6 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;
}
--
1.9.1
Powered by blists - more mailing lists