linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] bus: mvebu-mbus: fix iounmap() in error path
@ 2016-11-16 22:54 Luis Henriques
  2016-11-18 12:48 ` Gregory CLEMENT
  0 siblings, 1 reply; 2+ messages in thread
From: Luis Henriques @ 2016-11-16 22:54 UTC (permalink / raw)
  To: Gregory CLEMENT, Arnd Bergmann, Ben Dooks, Evan Wang, Marcin Wojtas
  Cc: linux-kernel, Luis Henriques

This patch fixes the following Coccinelle error:

./drivers/bus/mvebu-mbus.c:1115:2-8: \
	ERROR: missing iounmap; ioremap on line 1108 \
	and execution via conditional on line 1113

Although all mvebu_mbus_common_init() callers seem to actually use
&mbus_state in the 1st argument, this is still a bug that could be
triggered by future changes.

Signed-off-by: Luis Henriques <henrix@camandro.org>
---
 drivers/bus/mvebu-mbus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/bus/mvebu-mbus.c b/drivers/bus/mvebu-mbus.c
index c7f396903184..449466eff56f 100644
--- a/drivers/bus/mvebu-mbus.c
+++ b/drivers/bus/mvebu-mbus.c
@@ -1111,7 +1111,7 @@ static int __init mvebu_mbus_common_init(struct mvebu_mbus_state *mbus,
 
 	mbus->sdramwins_base = ioremap(sdramwins_phys_base, sdramwins_size);
 	if (!mbus->sdramwins_base) {
-		iounmap(mbus_state.mbuswins_base);
+		iounmap(mbus->mbuswins_base);
 		return -ENOMEM;
 	}
 

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] bus: mvebu-mbus: fix iounmap() in error path
  2016-11-16 22:54 [PATCH] bus: mvebu-mbus: fix iounmap() in error path Luis Henriques
@ 2016-11-18 12:48 ` Gregory CLEMENT
  0 siblings, 0 replies; 2+ messages in thread
From: Gregory CLEMENT @ 2016-11-18 12:48 UTC (permalink / raw)
  To: Luis Henriques
  Cc: Arnd Bergmann, Ben Dooks, Evan Wang, Marcin Wojtas, linux-kernel

Hi Luis,
 
 On mer., nov. 16 2016, Luis Henriques <henrix@camandro.org> wrote:

> This patch fixes the following Coccinelle error:
>
> ./drivers/bus/mvebu-mbus.c:1115:2-8: \
> 	ERROR: missing iounmap; ioremap on line 1108 \
> 	and execution via conditional on line 1113
>
> Although all mvebu_mbus_common_init() callers seem to actually use
> &mbus_state in the 1st argument, this is still a bug that could be
> triggered by future changes.
>
> Signed-off-by: Luis Henriques <henrix@camandro.org>

Acked-by: Gregory CLEMENT <gregory.clement@free-electrons.com>

and applied on mvebu/dt

Thanks,

Gregory

> ---
>  drivers/bus/mvebu-mbus.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/bus/mvebu-mbus.c b/drivers/bus/mvebu-mbus.c
> index c7f396903184..449466eff56f 100644
> --- a/drivers/bus/mvebu-mbus.c
> +++ b/drivers/bus/mvebu-mbus.c
> @@ -1111,7 +1111,7 @@ static int __init mvebu_mbus_common_init(struct mvebu_mbus_state *mbus,
>  
>  	mbus->sdramwins_base = ioremap(sdramwins_phys_base, sdramwins_size);
>  	if (!mbus->sdramwins_base) {
> -		iounmap(mbus_state.mbuswins_base);
> +		iounmap(mbus->mbuswins_base);
>  		return -ENOMEM;
>  	}
>  

-- 
Gregory Clement, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-11-18 12:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-16 22:54 [PATCH] bus: mvebu-mbus: fix iounmap() in error path Luis Henriques
2016-11-18 12:48 ` Gregory CLEMENT

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).