* [PATCH] mips: txx9: fix iounmap related issue
@ 2018-09-06 4:19 Ding Xiang
2018-09-06 15:04 ` Atsushi Nemoto
2018-09-06 21:16 ` Paul Burton
0 siblings, 2 replies; 3+ messages in thread
From: Ding Xiang @ 2018-09-06 4:19 UTC (permalink / raw)
To: ralf, paul.burton, jhogan, linux-mips, linux-kernel; +Cc: dingxiang
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>
---
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] mips: txx9: fix iounmap related issue
2018-09-06 4:19 [PATCH] mips: txx9: fix iounmap related issue Ding Xiang
@ 2018-09-06 15:04 ` Atsushi Nemoto
2018-09-06 21:16 ` Paul Burton
1 sibling, 0 replies; 3+ messages in thread
From: Atsushi Nemoto @ 2018-09-06 15:04 UTC (permalink / raw)
To: dingxiang; +Cc: ralf, paul.burton, jhogan, linux-mips, linux-kernel
On Thu, 6 Sep 2018 12:19:19 +0800, Ding Xiang <dingxiang@cmss.chinamobile.com> wrote:
> 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>
> ---
> arch/mips/txx9/generic/setup.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
Thank you for fixing this long standing issue. It looks OK for me.
Reviewed-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
---
Atsushi Nemoto
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mips: txx9: fix iounmap related issue
2018-09-06 4:19 [PATCH] mips: txx9: fix iounmap related issue Ding Xiang
2018-09-06 15:04 ` Atsushi Nemoto
@ 2018-09-06 21:16 ` Paul Burton
1 sibling, 0 replies; 3+ messages in thread
From: Paul Burton @ 2018-09-06 21:16 UTC (permalink / raw)
To: Ding Xiang, Atsushi Nemoto; +Cc: ralf, jhogan, linux-mips, linux-kernel
Hi Ding,
On Thu, Sep 06, 2018 at 12:19:19PM +0800, Ding Xiang wrote:
> 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>
> ---
> arch/mips/txx9/generic/setup.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
Applied to mips-next for 4.20 - thanks, and thanks to Atsushi for
reviewing too!
Paul
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-09-06 21:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-06 4:19 [PATCH] mips: txx9: fix iounmap related issue Ding Xiang
2018-09-06 15:04 ` Atsushi Nemoto
2018-09-06 21:16 ` Paul Burton
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.