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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191209090020.GG3468@dell>
Date:   Mon, 9 Dec 2019 09:00:20 +0000
From:   Lee Jones <lee.jones@...aro.org>
To:     Chuhong Yuan <hslester96@...il.com>
Cc:     linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mfd: sm501: fix mismatches of request_mem_region

On Sat, 16 Nov 2019, Chuhong Yuan wrote:

> This driver misuses release_resource + kfree to match request_mem_region,
> which is incorrect.
> The right way is to use release_mem_region.
> Replace the mismatched calls with the right ones to fix it.
> 
> Signed-off-by: Chuhong Yuan <hslester96@...il.com>
> ---
>  drivers/mfd/sm501.c | 19 +++++++------------
>  1 file changed, 7 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/mfd/sm501.c b/drivers/mfd/sm501.c
> index 154270f8d8d7..e49787e6bb93 100644
> --- a/drivers/mfd/sm501.c
> +++ b/drivers/mfd/sm501.c
> @@ -1086,8 +1086,7 @@ static int sm501_register_gpio(struct sm501_devdata *sm)
>  	iounmap(gpio->regs);
>  
>   err_claimed:
> -	release_resource(gpio->regs_res);
> -	kfree(gpio->regs_res);
> +	release_mem_region(iobase, 0x20);
>  
>  	return ret;
>  }
> @@ -1095,6 +1094,7 @@ static int sm501_register_gpio(struct sm501_devdata *sm)
>  static void sm501_gpio_remove(struct sm501_devdata *sm)
>  {
>  	struct sm501_gpio *gpio = &sm->gpio;
> +	resource_size_t iobase = sm->io_res->start + SM501_GPIO;

Shouldn't this be 'struct resource *'?

-- 
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ