Rui Wang 9d98bcec73 x86/ioapic: Fix incorrect pointers in ioapic_setup_resources()
On a 4-socket Brickland system, hot-removing one ioapic is fine.
Hot-removing the 2nd one causes panic in mp_unregister_ioapic()
while calling release_resource().

It is because the iomem_res pointer has already been released
when removing the first ioapic.

To explain the use of &res[num] here: res is assigned to ioapic_resources,
and later in ioapic_insert_resources() we do:

	struct resource *r = ioapic_resources;

        for_each_ioapic(i) {
                insert_resource(&iomem_resource, r);
                r++;
        }

Here 'r' is treated as an arry of 'struct resource', and the r++ ensures
that each element of the array is inserted separately. Thus we should call
release_resouce() on each element at &res[num].

Fix it by assigning the correct pointers to ioapics[i].iomem_res in
ioapic_setup_resources().

Signed-off-by: Rui Wang <rui.y.wang@intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: tony.luck@intel.com
Cc: linux-pci@vger.kernel.org
Cc: rjw@rjwysocki.net
Cc: linux-acpi@vger.kernel.org
Cc: bhelgaas@google.com
Link: http://lkml.kernel.org/r/1465369193-4816-3-git-send-email-rui.y.wang@intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2016-06-10 14:45:54 +02:00
..
2016-05-16 19:41:41 -07:00
2016-03-29 10:45:04 +02:00
2014-12-13 12:42:51 -08:00
2015-08-25 09:59:19 +02:00
2015-11-23 09:04:05 +01:00
2016-04-22 10:29:07 +02:00
2015-11-23 09:44:58 +01:00
2016-02-24 08:44:58 +01:00
2016-01-30 11:22:17 +01:00
2016-04-16 13:21:40 +02:00
2015-10-21 11:17:32 +02:00
2015-11-05 13:07:54 +01:00
2016-02-20 00:21:44 -05:00
2014-10-17 13:40:52 -07:00