From patchwork Wed May 21 08:22:58 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aaron Lu X-Patchwork-Id: 4215091 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id EBEE4BEEAB for ; Wed, 21 May 2014 08:23:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BD49F2040F for ; Wed, 21 May 2014 08:23:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C85FA203AD for ; Wed, 21 May 2014 08:23:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751163AbaEUIXB (ORCPT ); Wed, 21 May 2014 04:23:01 -0400 Received: from mga11.intel.com ([192.55.52.93]:33795 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750972AbaEUIXA (ORCPT ); Wed, 21 May 2014 04:23:00 -0400 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 21 May 2014 01:23:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.98,878,1392192000"; d="scan'208";a="535326349" Received: from aaronlu.sh.intel.com ([10.239.37.122]) by fmsmga001.fm.intel.com with ESMTP; 21 May 2014 01:22:58 -0700 Message-ID: <537C6262.5030500@intel.com> Date: Wed, 21 May 2014 16:22:58 +0800 From: Aaron Lu MIME-Version: 1.0 To: Kui Zhang CC: "linux-kernel@vger.kernel.org" , ACPI Devel Mailing List , "Rafael J. Wysocki" , Zhang Rui Subject: Re: rmmod thermal, unable to handle kernel NULL pointer dereference References: In-Reply-To: Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 05/21/2014 01:57 PM, Kui Zhang wrote: > Hello, > > I get following error when rmmod thermal. > > rmmod thermal > Killed Thanks for the report. Here is a fix patch that should solve this problem. From: Aaron Lu Date: Wed, 21 May 2014 16:00:42 +0800 Subject: [PATCH] ACPI / thermal: fix workqueue destroy order When the thermal module is to be removed, we should destroy the wq acpi_thermal_pm_queue after the ACPI driver's remove callback is executed as we will need to flush the workqueue there, or a NULL pointer access will be hit. Reported-by: Kui Zhang Reference: http://www.spinics.net/lists/kernel/msg1747251.html Cc: All applicable Signed-off-by: Aaron Lu --- drivers/acpi/thermal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c index c1e31a41f949..25bbc55dca89 100644 --- a/drivers/acpi/thermal.c +++ b/drivers/acpi/thermal.c @@ -1278,8 +1278,8 @@ static int __init acpi_thermal_init(void) static void __exit acpi_thermal_exit(void) { - destroy_workqueue(acpi_thermal_pm_queue); acpi_bus_unregister_driver(&acpi_thermal_driver); + destroy_workqueue(acpi_thermal_pm_queue); return; }