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:   Tue, 28 Jul 2020 14:18:04 -0500
From:   Dinh Nguyen <dinguyen@...nel.org>
To:     Yu Kuai <yukuai3@...wei.com>, linux@...linux.org.uk,
        atull@...nsource.altera.com, khilman@...aro.org
Cc:     linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
        yi.zhang@...wei.com
Subject: Re: [PATCH] ARM: socfpga: PM: add missing put_device() call in
 socfpga_setup_ocram_self_refresh()



On 7/21/20 8:45 AM, Yu Kuai wrote:
> if of_find_device_by_node() succeed, socfpga_setup_ocram_self_refresh
> doesn't have a corresponding put_device(). Thus add a jump target to
> fix the exception handling for this function implementation.
> 
> Fixes: 44fd8c7d4005 ("ARM: socfpga: support suspend to ram")
> Signed-off-by: Yu Kuai <yukuai3@...wei.com>
> ---
>  arch/arm/mach-socfpga/pm.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm/mach-socfpga/pm.c b/arch/arm/mach-socfpga/pm.c
> index 6ed887cf8dc9..365c0428b21b 100644
> --- a/arch/arm/mach-socfpga/pm.c
> +++ b/arch/arm/mach-socfpga/pm.c
> @@ -49,14 +49,14 @@ static int socfpga_setup_ocram_self_refresh(void)
>  	if (!ocram_pool) {
>  		pr_warn("%s: ocram pool unavailable!\n", __func__);
>  		ret = -ENODEV;
> -		goto put_node;
> +		goto put_device;
>  	}
>  
>  	ocram_base = gen_pool_alloc(ocram_pool, socfpga_sdram_self_refresh_sz);
>  	if (!ocram_base) {
>  		pr_warn("%s: unable to alloc ocram!\n", __func__);
>  		ret = -ENOMEM;
> -		goto put_node;
> +		goto put_device;
>  	}
>  
>  	ocram_pbase = gen_pool_virt_to_phys(ocram_pool, ocram_base);
> @@ -67,7 +67,7 @@ static int socfpga_setup_ocram_self_refresh(void)
>  	if (!suspend_ocram_base) {
>  		pr_warn("%s: __arm_ioremap_exec failed!\n", __func__);
>  		ret = -ENOMEM;
> -		goto put_node;
> +		goto put_device;
>  	}
>  
>  	/* Copy the code that puts DDR in self refresh to ocram */
> @@ -81,6 +81,8 @@ static int socfpga_setup_ocram_self_refresh(void)
>  	if (!socfpga_sdram_self_refresh_in_ocram)
>  		ret = -EFAULT;
>  
> +put_device:
> +	put_device(&pdev->dev);
>  put_node:
>  	of_node_put(np);
>  
> 

Applied!

Thanks,
Dinh

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ