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]
Message-ID: <20220525064731.k4lgjrcu355b73q6@vireshk-i7>
Date:   Wed, 25 May 2022 12:17:31 +0530
From:   Viresh Kumar <viresh.kumar@...aro.org>
To:     Tang Bin <tangbin@...s.chinamobile.com>
Cc:     vireshk@...nel.org, nm@...com, sboyd@...nel.org,
        linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] opp: Fix error check in dev_pm_opp_attach_genpd()

On 24-05-22, 20:31, Tang Bin wrote:
> dev_pm_domain_attach_by_name() may return NULL in some cases,
> so IS_ERR() doesn't meet the requirements. Thus fix it.
> 
> Fixes: 6319aee10e53 ("opp: Attach genpds to devices from within OPP core")
> Signed-off-by: Tang Bin <tangbin@...s.chinamobile.com>
> ---
>  drivers/opp/core.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/opp/core.c b/drivers/opp/core.c
> index 2945f3c1c..56cae6ee2 100644
> --- a/drivers/opp/core.c
> +++ b/drivers/opp/core.c
> @@ -2409,8 +2409,8 @@ struct opp_table *dev_pm_opp_attach_genpd(struct device *dev,
>  		}
>  
>  		virt_dev = dev_pm_domain_attach_by_name(dev, *name);
> -		if (IS_ERR(virt_dev)) {
> -			ret = PTR_ERR(virt_dev);
> +		if (IS_ERR_OR_NULL(virt_dev)) {
> +			ret = PTR_ERR(virt_dev) ? : -ENODATA;

I have changed this to ENODEV instead.

>  			dev_err(dev, "Couldn't attach to pm_domain: %d\n", ret);
>  			goto err;
>  		}

Applied. Thanks.

-- 
viresh

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ