From patchwork Thu Jan 20 09:26:03 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: durgadoss.r@intel.com X-Patchwork-Id: 491371 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p0K9OZH2028501 for ; Thu, 20 Jan 2011 09:27:39 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753230Ab1ATJ1i (ORCPT ); Thu, 20 Jan 2011 04:27:38 -0500 Received: from mga02.intel.com ([134.134.136.20]:37821 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752110Ab1ATJ1h convert rfc822-to-8bit (ORCPT ); Thu, 20 Jan 2011 04:27:37 -0500 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 20 Jan 2011 01:27:37 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.60,350,1291622400"; d="scan'208";a="594757801" Received: from pgsmsx603.gar.corp.intel.com ([10.221.43.87]) by orsmga002.jf.intel.com with ESMTP; 20 Jan 2011 01:27:36 -0800 Received: from pgsmsx509.gar.corp.intel.com (172.30.13.17) by pgsmsx603.gar.corp.intel.com (10.221.43.87) with Microsoft SMTP Server (TLS) id 8.2.254.0; Thu, 20 Jan 2011 17:26:06 +0800 Received: from bgsmsx502.gar.corp.intel.com (10.223.4.248) by PGSMSX509.gar.corp.intel.com (172.30.13.17) with Microsoft SMTP Server (TLS) id 8.2.254.0; Thu, 20 Jan 2011 17:26:06 +0800 Received: from bgsmsx502.gar.corp.intel.com ([10.223.4.248]) by bgsmsx502.gar.corp.intel.com ([10.223.4.248]) with mapi; Thu, 20 Jan 2011 14:56:04 +0530 From: "R, Durgadoss" To: Len Brown , "Zhang, Rui" CC: "linux-acpi@vger.kernel.org" Date: Thu, 20 Jan 2011 14:56:03 +0530 Subject: Patch[1/1]:ThermalFramework:Fix_crash_during_hwmon_unregister Thread-Topic: Patch[1/1]:ThermalFramework:Fix_crash_during_hwmon_unregister Thread-Index: Acu4hA799Q9q0uiATkOqcFz4xX2kcg== Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US MIME-Version: 1.0 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 20 Jan 2011 09:27:58 +0000 (UTC) diff --git a/drivers/thermal/thermal_sys.c b/drivers/thermal/thermal_sys.c index 13c72c6..eef2e14 100644 --- a/drivers/thermal/thermal_sys.c +++ b/drivers/thermal/thermal_sys.c @@ -556,7 +556,8 @@ thermal_remove_hwmon_sysfs(struct thermal_zone_device *tz) tz->hwmon = NULL; device_remove_file(hwmon->device, &tz->temp_input.attr); - device_remove_file(hwmon->device, &tz->temp_crit.attr); + if (tz->ops->get_crit_temp) + device_remove_file(hwmon->device, &tz->temp_crit.attr); mutex_lock(&thermal_list_lock); list_del(&tz->hwmon_node);