public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: James Hogan <jhogan@kernel.org>
To: Vasyl Gomonovych <gomonovych@gmail.com>
Cc: ralf@linux-mips.org, paul.gortmaker@windriver.com,
	linux-mips@linux-mips.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] MIPS: TXx9: Add missing iounmap
Date: Mon, 5 Mar 2018 22:37:36 +0000	[thread overview]
Message-ID: <20180305221833.GJ4197@saruman> (raw)
In-Reply-To: <1511473795-20137-1-git-send-email-gomonovych@gmail.com>

[-- 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 --]

      reply	other threads:[~2018-03-05 22:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-23 21:49 [PATCH] MIPS: TXx9: Add missing iounmap Vasyl Gomonovych
2018-03-05 22:37 ` James Hogan [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180305221833.GJ4197@saruman \
    --to=jhogan@kernel.org \
    --cc=gomonovych@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=paul.gortmaker@windriver.com \
    --cc=ralf@linux-mips.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox