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: <1699761.45DYuq6sLL@aspire.rjw.lan>
Date:   Wed, 16 Jan 2019 13:00:54 +0100
From:   "Rafael J. Wysocki" <rjw@...ysocki.net>
To:     Aditya Pakki <pakki001@....edu>
Cc:     kjlu@....edu, Len Brown <len.brown@...el.com>,
        Pavel Machek <pavel@....cz>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] v2 pm: clk: fix a missing check of clk_prepare

On Saturday, January 5, 2019 8:58:45 PM CET Aditya Pakki wrote:
> clk_prepare() could fail, so let's check its status, and if it fails,
> issue an error message and change the clock_entry_status to
> PCE_STATUS_ERROR
> 
> Signed-off-by: Aditya Pakki <pakki001@....edu>
> ---
>  drivers/base/power/clock_ops.c | 13 +++++++++----
>  1 file changed, 9 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/base/power/clock_ops.c b/drivers/base/power/clock_ops.c
> index 5a42ae4078c2..732764becafe 100644
> --- a/drivers/base/power/clock_ops.c
> +++ b/drivers/base/power/clock_ops.c
> @@ -65,10 +65,15 @@ static void pm_clk_acquire(struct device *dev, struct pm_clock_entry *ce)
>  	if (IS_ERR(ce->clk)) {
>  		ce->status = PCE_STATUS_ERROR;
>  	} else {
> -		clk_prepare(ce->clk);
> -		ce->status = PCE_STATUS_ACQUIRED;
> -		dev_dbg(dev, "Clock %pC con_id %s managed by runtime PM.\n",
> -			ce->clk, ce->con_id);
> +		if (clk_prepare(ce->clk)) {
> +			ce->status = PCE_STATUS_ERROR;
> +			dev_err(dev, "clk_prepare failed\n");
> +		} else {
> +			ce->status = PCE_STATUS_ACQUIRED;
> +			dev_dbg(dev,
> +				"Clock %pC con_id %s managed by runtime PM.\n",
> +				ce->clk, ce->con_id);
> +		}
>  	}
>  }
>  
> 

Applied (with some minor modifications), thanks!


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ