* [PATCH] MIPS: TXx9: Add missing iounmap
@ 2017-11-23 21:49 Vasyl Gomonovych
2018-03-05 22:37 ` James Hogan
0 siblings, 1 reply; 2+ messages in thread
From: Vasyl Gomonovych @ 2017-11-23 21:49 UTC (permalink / raw)
To: ralf, paul.gortmaker, jhogan, linux-mips; +Cc: linux-kernel, gomonovych
Add the missing iounmap() before put_device and
return from txx9_sramc_init().
Signed-off-by: Vasyl Gomonovych <gomonovych@gmail.com>
---
arch/mips/txx9/generic/setup.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/mips/txx9/generic/setup.c b/arch/mips/txx9/generic/setup.c
index 1791a44ee570..6ef5edb85d68 100644
--- a/arch/mips/txx9/generic/setup.c
+++ b/arch/mips/txx9/generic/setup.c
@@ -965,6 +965,8 @@ void __init txx9_sramc_init(struct resource *r)
}
return;
exit_put:
+ if (dev->base)
+ iounmap(dev->base);
put_device(&dev->dev);
return;
}
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] MIPS: TXx9: Add missing iounmap
2017-11-23 21:49 [PATCH] MIPS: TXx9: Add missing iounmap Vasyl Gomonovych
@ 2018-03-05 22:37 ` James Hogan
0 siblings, 0 replies; 2+ messages in thread
From: James Hogan @ 2018-03-05 22:37 UTC (permalink / raw)
To: Vasyl Gomonovych; +Cc: ralf, paul.gortmaker, linux-mips, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1201 bytes --]
On Thu, Nov 23, 2017 at 10:49:55PM +0100, Vasyl Gomonovych wrote:
> Add the missing iounmap() before put_device and
> return from txx9_sramc_init().
>
> Signed-off-by: Vasyl Gomonovych <gomonovych@gmail.com>
> ---
> arch/mips/txx9/generic/setup.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/arch/mips/txx9/generic/setup.c b/arch/mips/txx9/generic/setup.c
> index 1791a44ee570..6ef5edb85d68 100644
> --- a/arch/mips/txx9/generic/setup.c
> +++ b/arch/mips/txx9/generic/setup.c
> @@ -965,6 +965,8 @@ void __init txx9_sramc_init(struct resource *r)
> }
> return;
> exit_put:
> + if (dev->base)
> + iounmap(dev->base);
I think if dev->base was NULL then a different error path would have
been taken already.
More concerning to be honest though is the sysfs_create_bin_file() error
handling just above here, which seems to iounmap() and kfree() *after*
device_unregister(). txx9_device_release() already kfrees it.
The iounmap() call should prresumably move before the kfree() in
txx9_device_release(), and the kfree() after device_unregister() should
be removed?
Cheers
James
> put_device(&dev->dev);
> return;
> }
> --
> 1.9.1
>
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-03-05 22:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-23 21:49 [PATCH] MIPS: TXx9: Add missing iounmap Vasyl Gomonovych
2018-03-05 22:37 ` James Hogan
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.