mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] Thermal: Fix bug on generic thermal framework.
@ 2012-09-24  2:05 Jonghwa Lee
  2012-09-24  8:08 ` R, Durgadoss
  0 siblings, 1 reply; 8+ messages in thread
From: Jonghwa Lee @ 2012-09-24  2:05 UTC (permalink / raw)
  To: linux-pml
  Cc: linux-kernel, Len Brown, Rafael J. Wysocki, Andrew Morton,
	Amit Kachhap, Durgadoss R, Jonghwa Lee

When system fails to bind cooling devices to thermal zone device during
registering thermal zone device, it leaves registering without canceling
delayed work. It probably makes panic if polling rate is not enough to release
that work from workqueue. So it is better to ignore initialization of polling
work to prevent that unexpected state.

Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
---
 drivers/thermal/thermal_sys.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/thermal/thermal_sys.c b/drivers/thermal/thermal_sys.c
index 2ab31e4..744e69d 100644
--- a/drivers/thermal/thermal_sys.c
+++ b/drivers/thermal/thermal_sys.c
@@ -1351,12 +1351,14 @@ struct thermal_zone_device *thermal_zone_device_register(const char *type,
 		}
 	mutex_unlock(&thermal_list_lock);
 
+	if (result)
+		goto unregister;
+
 	INIT_DELAYED_WORK(&(tz->poll_queue), thermal_zone_device_check);
 
 	thermal_zone_device_update(tz);
 
-	if (!result)
-		return tz;
+	return tz;
 
 unregister:
 	release_idr(&thermal_tz_idr, &thermal_idr_lock, tz->id);
-- 
1.7.4.1


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

end of thread, other threads:[~2012-09-25  4:21 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-24  2:05 [PATCH] Thermal: Fix bug on generic thermal framework Jonghwa Lee
2012-09-24  8:08 ` R, Durgadoss
2012-09-24  8:20   ` jonghwa3.lee
2012-09-24  8:57   ` Zhang Rui
2012-09-25  1:12     ` jonghwa3.lee
2012-09-25  1:58       ` Zhang Rui
2012-09-25  3:04         ` R, Durgadoss
2012-09-25  4:21           ` jonghwa3.lee

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome