lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Mon, 5 Mar 2018 22:37:36 +0000
From:   James Hogan <jhogan@...nel.org>
To:     Vasyl Gomonovych <gomonovych@...il.com>
Cc:     ralf@...ux-mips.org, paul.gortmaker@...driver.com,
        linux-mips@...ux-mips.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] MIPS: TXx9: Add missing iounmap

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@...il.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
> 

Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ