linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] PM / devfreq: Check NULL governor in available_governors_show
@ 2019-09-24  7:26 Leonard Crestez
  2019-10-31 14:22 ` Leonard Crestez
  0 siblings, 1 reply; 2+ messages in thread
From: Leonard Crestez @ 2019-09-24  7:26 UTC (permalink / raw)
  To: MyungJoo Ham, Kyungmin Park, Chanwoo Choi, Matthias Kaehlcke
  Cc: Artur Świgoń,
	linux-pm, linux-imx, linux-arm-kernel, Lukasz Luba

The governor is initialized after sysfs attributes become visible so in
theory the governor field can be NULL here.

Fixes: bcf23c79c4e46 ("PM / devfreq: Fix available_governor sysfs")
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
---
 drivers/devfreq/devfreq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Changes since v1:
* Add Fixes tag and Reviewed-by
Link to v1: https://patchwork.kernel.org/patch/11157333/

Don't add cc: stable since it's a theoretical race condition.

diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
index b905963cea7d..60859a2400bc 100644
--- a/drivers/devfreq/devfreq.c
+++ b/drivers/devfreq/devfreq.c
@@ -1193,11 +1193,11 @@ static ssize_t available_governors_show(struct device *d,
 
 	/*
 	 * The devfreq with immutable governor (e.g., passive) shows
 	 * only own governor.
 	 */
-	if (df->governor->immutable) {
+	if (df->governor && df->governor->immutable) {
 		count = scnprintf(&buf[count], DEVFREQ_NAME_LEN,
 				  "%s ", df->governor_name);
 	/*
 	 * The devfreq device shows the registered governor except for
 	 * immutable governors such as passive governor .
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] PM / devfreq: Check NULL governor in available_governors_show
  2019-09-24  7:26 [PATCH v2] PM / devfreq: Check NULL governor in available_governors_show Leonard Crestez
@ 2019-10-31 14:22 ` Leonard Crestez
  0 siblings, 0 replies; 2+ messages in thread
From: Leonard Crestez @ 2019-10-31 14:22 UTC (permalink / raw)
  To: MyungJoo Ham, Kyungmin Park
  Cc: Artur Świgoń,
	linux-pm, Chanwoo Choi, Matthias Kaehlcke, dl-linux-imx,
	linux-arm-kernel

On 24.09.2019 10:26, Leonard Crestez wrote:
> The governor is initialized after sysfs attributes become visible so in
> theory the governor field can be NULL here.
> 
> Fixes: bcf23c79c4e46 ("PM / devfreq: Fix available_governor sysfs")
> Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
> Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
> Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>

Gentle ping?

This is a very simple bugfix with no dependencies which has already been 
reviewed. Same applies to the following patch:

https://patchwork.kernel.org/patch/11158225/

> ---
>   drivers/devfreq/devfreq.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Changes since v1:
> * Add Fixes tag and Reviewed-by
> Link to v1: https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatchwork.kernel.org%2Fpatch%2F11157333%2F&amp;data=02%7C01%7Cleonard.crestez%40nxp.com%7C857374c5be41480ec9ad08d740c09549%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C637049068194432556&amp;sdata=BIV9uq2WOBIrDLwGBWiM2wvHPselZnqdtOUV1uzzBsQ%3D&amp;reserved=0
> 
> Don't add cc: stable since it's a theoretical race condition.
> 
> diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
> index b905963cea7d..60859a2400bc 100644
> --- a/drivers/devfreq/devfreq.c
> +++ b/drivers/devfreq/devfreq.c
> @@ -1193,11 +1193,11 @@ static ssize_t available_governors_show(struct device *d,
>   
>   	/*
>   	 * The devfreq with immutable governor (e.g., passive) shows
>   	 * only own governor.
>   	 */
> -	if (df->governor->immutable) {
> +	if (df->governor && df->governor->immutable) {
>   		count = scnprintf(&buf[count], DEVFREQ_NAME_LEN,
>   				  "%s ", df->governor_name);
>   	/*
>   	 * The devfreq device shows the registered governor except for
>   	 * immutable governors such as passive governor .
> 


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-10-31 14:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-24  7:26 [PATCH v2] PM / devfreq: Check NULL governor in available_governors_show Leonard Crestez
2019-10-31 14:22 ` Leonard Crestez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).