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: <1cd494d4-55e5-858b-1629-91c7945fbd9a@samsung.com>
Date:   Mon, 23 Dec 2019 09:51:16 +0900
From:   Chanwoo Choi <cw00.choi@...sung.com>
To:     Yangtao Li <tiny.windzz@...il.com>, myungjoo.ham@...sung.com,
        kyungmin.park@...sung.com, kgene@...nel.org, krzk@...nel.org,
        linux-pm@...r.kernel.org, linux-samsung-soc@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 1/2] PM / devfreq: rk3399_dmc: Disable devfreq-event
 device when fails

On 12/23/19 2:41 AM, Yangtao Li wrote:
> The probe process may fail, but the devfreq event device remains
> enabled. Call devfreq_event_disable_edev on the error return path.
> 
> Signed-off-by: Yangtao Li <tiny.windzz@...il.com>
> ---
> v2:
> -change subject
> -rename lable to err_edev
> -fix error path handler
> ---
>  drivers/devfreq/rk3399_dmc.c | 17 ++++++++++++-----
>  1 file changed, 12 insertions(+), 5 deletions(-)
> 
> 
> diff --git a/drivers/devfreq/rk3399_dmc.c b/drivers/devfreq/rk3399_dmc.c
> index 2f1027c5b647..4288745304c7 100644
> --- a/drivers/devfreq/rk3399_dmc.c
> +++ b/drivers/devfreq/rk3399_dmc.c
> @@ -364,7 +364,8 @@ static int rk3399_dmcfreq_probe(struct platform_device *pdev)
>  			if (res.a0) {
>  				dev_err(dev, "Failed to set dram param: %ld\n",
>  					res.a0);
> -				return -EINVAL;
> +				ret = -EINVAL;
> +				goto err_edev;
>  			}
>  		}
>  	}
> @@ -373,8 +374,10 @@ static int rk3399_dmcfreq_probe(struct platform_device *pdev)
>  	if (node) {
>  		data->regmap_pmu = syscon_node_to_regmap(node);
>  		of_node_put(node);
> -		if (IS_ERR(data->regmap_pmu))
> -			return PTR_ERR(data->regmap_pmu);
> +		if (IS_ERR(data->regmap_pmu)) {
> +			ret = PTR_ERR(data->regmap_pmu);
> +			goto err_edev;
> +		}
>  	}
>  
>  	regmap_read(data->regmap_pmu, RK3399_PMUGRF_OS_REG2, &val);
> @@ -392,7 +395,8 @@ static int rk3399_dmcfreq_probe(struct platform_device *pdev)
>  		data->odt_dis_freq = data->timing.lpddr4_odt_dis_freq;
>  		break;
>  	default:
> -		return -EINVAL;
> +		ret = -EINVAL;
> +		goto err_edev;
>  	};
>  
>  	arm_smccc_smc(ROCKCHIP_SIP_DRAM_FREQ, 0, 0,
> @@ -426,7 +430,8 @@ static int rk3399_dmcfreq_probe(struct platform_device *pdev)
>  	 */
>  	if (dev_pm_opp_of_add_table(dev)) {
>  		dev_err(dev, "Invalid operating-points in device tree.\n");
> -		return -EINVAL;
> +		ret = -EINVAL;
> +		goto err_edev;
>  	}
>  
>  	of_property_read_u32(np, "upthreshold",
> @@ -466,6 +471,8 @@ static int rk3399_dmcfreq_probe(struct platform_device *pdev)
>  
>  err_free_opp:
>  	dev_pm_opp_of_remove_table(&pdev->dev);
> +err_edev:
> +	devfreq_event_disable_edev(data->edev);
>  	return ret;
>  }
>  
> 

Applied it.

-- 
Best Regards,
Chanwoo Choi
Samsung Electronics

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ