stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Patch "PM / devfreq: Fix the bug of devfreq_add_device when governor is NULL" has been added to the 4.9-stable tree
@ 2017-01-23 16:03 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2017-01-23 16:03 UTC (permalink / raw)
  To: cw00.choi, gregkh, rafael.j.wysocki; +Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    PM / devfreq: Fix the bug of devfreq_add_device when governor is NULL

to the 4.9-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     pm-devfreq-fix-the-bug-of-devfreq_add_device-when-governor-is-null.patch
and it can be found in the queue-4.9 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From 73613b16cb5c5d5a659fc8832eff99eead3f9afb Mon Sep 17 00:00:00 2001
From: Chanwoo Choi <cw00.choi@samsung.com>
Date: Wed, 28 Dec 2016 20:52:35 +0900
Subject: PM / devfreq: Fix the bug of devfreq_add_device when governor is NULL

From: Chanwoo Choi <cw00.choi@samsung.com>

commit 73613b16cb5c5d5a659fc8832eff99eead3f9afb upstream.

This patch fixes the bug of devfreq_add_device(). The devfreq device must
have the default governor. If find_devfreq_governor() returns error,
devfreq_add_device() fail to add the devfreq instance.

Fixes: 1b5c1be2c88e (PM / devfreq: map devfreq drivers to governor using name)
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/devfreq/devfreq.c |   15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

--- a/drivers/devfreq/devfreq.c
+++ b/drivers/devfreq/devfreq.c
@@ -593,11 +593,16 @@ struct devfreq *devfreq_add_device(struc
 	list_add(&devfreq->node, &devfreq_list);
 
 	governor = find_devfreq_governor(devfreq->governor_name);
-	if (!IS_ERR(governor))
-		devfreq->governor = governor;
-	if (devfreq->governor)
-		err = devfreq->governor->event_handler(devfreq,
-					DEVFREQ_GOV_START, NULL);
+	if (IS_ERR(governor)) {
+		dev_err(dev, "%s: Unable to find governor for the device\n",
+			__func__);
+		err = PTR_ERR(governor);
+		goto err_init;
+	}
+
+	devfreq->governor = governor;
+	err = devfreq->governor->event_handler(devfreq, DEVFREQ_GOV_START,
+						NULL);
 	if (err) {
 		dev_err(dev, "%s: Unable to start governor for the device\n",
 			__func__);


Patches currently in stable-queue which might be from cw00.choi@samsung.com are

queue-4.9/clocksource-exynos_mct-clear-interrupt-when-cpu-is-shut-down.patch
queue-4.9/pm-devfreq-fix-the-bug-of-devfreq_add_device-when-governor-is-null.patch
queue-4.9/pm-devfreq-exynos-bus-fix-the-wrong-return-value.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-01-23 16:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-23 16:03 Patch "PM / devfreq: Fix the bug of devfreq_add_device when governor is NULL" has been added to the 4.9-stable tree gregkh

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).