From patchwork Sat Feb 7 06:41:37 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Len Brown X-Patchwork-Id: 6009 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n176gAeN018927 for ; Sat, 7 Feb 2009 06:42:25 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752795AbZBGGmY (ORCPT ); Sat, 7 Feb 2009 01:42:24 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752458AbZBGGmX (ORCPT ); Sat, 7 Feb 2009 01:42:23 -0500 Received: from vms173017pub.verizon.net ([206.46.173.17]:12280 "EHLO vms173017pub.verizon.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752795AbZBGGmN (ORCPT ); Sat, 7 Feb 2009 01:42:13 -0500 Received: from localhost.localdomain ([96.237.168.40]) by vms173017.mailsrvcs.net (Sun Java(tm) System Messaging Server 6.3-2.01 (built Jun 13 2007; 32bit)) with ESMTPA id <0KEO00J7BNXU9U32@vms173017.mailsrvcs.net> for linux-acpi@vger.kernel.org; Sat, 07 Feb 2009 00:41:55 -0600 (CST) Received: from localhost.localdomain (d975xbx2 [127.0.0.1]) by localhost.localdomain (8.14.2/8.14.2) with ESMTP id n176g5iP009925; Sat, 07 Feb 2009 01:42:05 -0500 Received: (from lenb@localhost) by localhost.localdomain (8.14.2/8.14.2/Submit) id n176g5At009924; Sat, 07 Feb 2009 01:42:05 -0500 From: Len Brown To: linux-acpi@vger.kernel.org Cc: Darren Salt , Andrew Morton , Len Brown Subject: [PATCH 29/30] eeepc-laptop: fix oops when changing backlight brightness during eeepc-laptop init Date: Sat, 07 Feb 2009 01:41:37 -0500 Message-id: <7695fb04aca62e2d8a7ca6ede50f6211e1d71e53.1233988827.git.len.brown@intel.com> X-Mailer: git-send-email 1.6.1.2.390.gba743 In-reply-to: <091d71e023557136e96f0e54f301497a3fc95dc3.1233988822.git.len.brown@intel.com> References: <091d71e023557136e96f0e54f301497a3fc95dc3.1233988822.git.len.brown@intel.com> In-reply-to: <091d71e023557136e96f0e54f301497a3fc95dc3.1233988822.git.len.brown@intel.com> References: <091d71e023557136e96f0e54f301497a3fc95dc3.1233988822.git.len.brown@intel.com> Organization: Intel Open Source Technology Center Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org From: Darren Salt I got the following oops while changing the backlight brightness during startup. When it happens, it prevents use of the hotkeys, Fn-Fx, and the lid button. It's a clear use-before-init, as I verified by testing with an appropriately-placed "else printk". BUG: unable to handle kernel NULL pointer dereference at 00000000 *pde = 00000000 Oops: 0002 [#1] PREEMPT SMP Pid: 160, comm: kacpi_notify Not tainted (2.6.28.1-eee901 #4) 901 EIP: 0060:[] [] eeepc_hotk_notify+26/da EFLAGS: 00010246 CPU: 1 Using defaults from ksymoops -t elf32-i386 -a i386 EAX: 00000009 EBX: 00000000 ECX: 00000009 EDX: f70dbf64 ESI: 00000029 EDI: f7335188 EBP: c02112c9 ESP: f70dbf80 DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068 f70731e0 f73acd50 c02164ac f7335180 f70aa040 c02112e6 f733518c c012b62f f70aa044 f70aa040 c012bdba f70aa04c 00000000 c012be6e 00000000 f70bdf80 c012e198 f70dbfc4 f70dbfc4 f70aa040 c012bdba 00000000 c012e0c9 c012e091 Call Trace: [] ? acpi_ev_notify_dispatch+4c/55 [] ? acpi_os_execute_deferred+1d/25 [] ? run_workqueue+71/f1 [] ? worker_thread+0/bf [] ? worker_thread+b4/bf [] ? autoremove_wake_function+0/2b [] ? worker_thread+0/bf [] ? kthread+38/5f [] ? kthread+0/5f [] ? kernel_thread_helper+7/10 Code: 00 00 00 00 c3 83 3d 60 5c 50 c0 00 56 89 d6 53 0f 84 c4 00 00 00 8d 42 e0 83 f8 0f 77 0f 8b 1d 68 5c 50 c0 89 d8 e8 a9 fa ff ff <89> 03 8b 1d 60 5c 50 c0 89 f2 83 e2 7f 0f b7 4c 53 10 8d 41 01 Signed-off-by: Darren Salt Signed-off-by: Andrew Morton Signed-off-by: Len Brown --- drivers/platform/x86/eeepc-laptop.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/drivers/platform/x86/eeepc-laptop.c b/drivers/platform/x86/eeepc-laptop.c index 9d93cb9..8fb983f 100644 --- a/drivers/platform/x86/eeepc-laptop.c +++ b/drivers/platform/x86/eeepc-laptop.c @@ -510,7 +510,8 @@ static int eeepc_hotk_check(void) static void notify_brn(void) { struct backlight_device *bd = eeepc_backlight_device; - bd->props.brightness = read_brightness(bd); + if (bd) + bd->props.brightness = read_brightness(bd); } static void eeepc_hotk_notify(acpi_handle handle, u32 event, void *data)