Tang Chen
dee1592638
ACPI / hotplug: Check scan handlers in acpi_scan_hot_remove()
When ACPI_HOTPLUG_MEMORY is not configured, memory_device_handler.attach
is not set. In acpi_scan_attach_handler(), the acpi_device->handler will
not be initialized.
In acpi_scan_hot_remove(), it doesn't check if acpi_device->handler is NULL.
If we do memory hot-remove without ACPI_HOTPLUG_MEMORY configured, the kernel
will panic.
BUG: unable to handle kernel NULL pointer dereference at 0000000000000088
IP: [<ffffffff813e318f>] acpi_device_hotplug+0x1d7/0x4c4
PGD 0
Oops: 0000 [#1] SMP
Modules linked in: sd_mod(E) sr_mod(E) cdrom(E) crc_t10dif(E) crct10dif_common(E) ata_piix(E) libata(E)
CPU: 0 PID: 41 Comm: kworker/u2:1 Tainted: G E 3.16.0-rc7--3.16-rc7-tangchen+ #20
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.7.5-0-ge51488c-20140602_164612-nilsson.home.kraxel.org 04/01/2014
Workqueue: kacpi_hotplug acpi_hotplug_work_fn
task: ffff8800182436c0 ti: ffff880018254000 task.ti: ffff880018254000
RIP: 0010:[<ffffffff813e318f>] [<ffffffff813e318f>] acpi_device_hotplug+0x1d7/0x4c4
RSP: 0000:ffff880018257da8 EFLAGS: 00000246
RAX: 0000000000000000 RBX: ffff88001cd8d800 RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffff88001e40e6f8 RDI: 0000000000000246
RBP: ffff880018257df0 R08: 0000000000000096 R09: 00000000000011a0
R10: 63735f6970636120 R11: 725f746f685f6e61 R12: 0000000000000003
R13: ffff88001cc1c400 R14: ffff88001e062028 R15: 0000000000000040
FS: 0000000000000000(0000) GS:ffff88001e400000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
CR2: 0000000000000088 CR3: 000000001a9a2000 CR4: 00000000000006f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 0000000000000000 DR7: 0000000000000000
Stack:
00000000523cab58 ffff88001cd8d9f8 ffff88001852d480 00000000523cab58
ffff88001852d480 ffff880018221e40 ffff88001cc1c400 ffff88001cce2d00
0000000000000040 ffff880018257e08 ffffffff813dc31d ffff88001852d480
Call Trace:
[<ffffffff813dc31d>] acpi_hotplug_work_fn+0x1e/0x29
[<ffffffff8108eefb>] process_one_work+0x17b/0x460
[<ffffffff8108f69d>] worker_thread+0x11d/0x5b0
[<ffffffff8108f580>] ? rescuer_thread+0x3a0/0x3a0
[<ffffffff81096811>] kthread+0xe1/0x100
[<ffffffff81096730>] ? kthread_create_on_node+0x1a0/0x1a0
[<ffffffff816cc6bc>] ret_from_fork+0x7c/0xb0
[<ffffffff81096730>] ? kthread_create_on_node+0x1a0/0x1a0
This patch fixes this problem by checking if acpi_device->handler is NULL
in acpi_scan_hot_remove().
Fixes: d22ddcbc4fb7 (ACPI / hotplug: Add demand_offline hotplug profile flag)
Signed-off-by: Tang Chen <tangchen@cn.fujitsu.com>
Cc: 3.14+ <stable@vger.kernel.org> # 3.14+
[rjw: Subject]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-08-07 21:16:23 +02:00
..
2014-06-03 14:53:35 +02:00
2014-05-27 18:13:08 +02:00
2014-07-07 01:13:46 +02:00
2014-05-30 16:04:35 +02:00
2014-05-27 18:13:08 +02:00
2013-09-30 19:46:13 +02:00
2014-06-17 13:46:48 +02:00
2014-05-30 16:04:36 +02:00
2014-05-27 01:38:23 +02:00
2014-06-03 23:11:52 +02:00
2014-07-09 14:31:04 +02:00
2014-05-16 16:27:35 +02:00
2014-07-07 23:37:06 +02:00
2014-03-19 01:57:46 +01:00
2013-08-22 08:34:39 -07:00
2014-05-08 00:35:50 +02:00
2014-06-03 23:12:27 +02:00
2014-03-19 02:06:15 +01:00
2014-05-06 01:52:09 +02:00
2014-05-30 16:04:36 +02:00
2013-12-07 01:03:14 +01:00
2013-12-07 01:03:14 +01:00
2014-05-20 13:23:07 +02:00
2014-04-07 14:11:35 +02:00
2014-01-06 00:13:22 +01:00
2014-07-07 13:20:30 +02:00
2013-12-07 01:03:14 +01:00
2014-02-20 21:42:09 +01:00
2014-02-11 00:35:46 +01:00
2013-12-07 01:03:14 +01:00
2014-05-30 16:04:36 +02:00
2014-05-10 13:51:36 +02:00
2014-05-30 16:04:36 +02:00
2014-02-03 10:39:43 -07:00
2014-05-27 18:13:08 +02:00
2014-06-17 14:01:56 +02:00
2014-02-20 21:37:42 +01:00
2014-03-19 02:01:57 +01:00
2014-03-20 13:20:47 +01:00
2014-01-06 00:13:22 +01:00
2014-03-19 02:01:57 +01:00
2014-02-05 01:06:21 +01:00
2014-04-01 22:09:50 +02:00
2014-05-16 16:36:03 +02:00
2014-01-24 15:51:02 -08:00
2014-02-21 00:27:47 +01:00
2013-12-07 01:38:45 +01:00
2014-02-27 00:21:05 +01:00
2012-04-20 11:19:35 -07:00
2014-07-07 22:11:09 +02:00
2014-03-19 01:57:46 +01:00
2013-12-07 01:03:14 +01:00
2007-12-14 15:14:06 -05:00
2014-08-07 21:16:23 +02:00
2014-06-07 00:18:07 +02:00
2013-01-17 14:11:06 +01:00
2014-03-19 02:01:57 +01:00
2014-06-17 14:01:56 +02:00
2014-05-29 13:28:14 +02:00
2014-05-26 14:38:57 +02:00
2014-07-07 23:38:10 +02:00
2014-07-07 23:38:10 +02:00
2013-12-07 01:03:14 +01:00