x86: Check irq_remapped instead of remapping_enabled in destroy_irq()
x86: Check irq_remapped instead of remapping_enabled in destroy_irq()

Russ Anderson reported:
| There is a regression that is causing a NULL pointer dereference
| in free_irte when shutting down xpc. git bisect narrowed it down
| to git commit d585d06(intr_remap: Simplify the code further), which
| changed free_irte(). Reverse applying the patch fixes the problem.

We need to use irq_remapped() for each irq instead of checking only
intr_remapping_enabled as there might be non remapped irqs even when
remapping is enabled.

[ tglx: use cfg instead of retrieving it again. Massaged changelog ]

Reported-bisected-and-tested-by: Russ Anderson <b201cce1c41ebc015324acfd842117e19cbd0c5e@sgi.com>
Signed-off-by: Yinghai Lu <0674548f4d596393408a51d6287a76ebba2f42aa@kernel.org>
Cc: Suresh Siddha <a42fd12510d3895be740fb89f87586733ee62f57@intel.com>
LKML-Reference: <ec83f0e082c586dd871bd0fca83f8832974be0ff@kernel.org>
Signed-off-by: Thomas Gleixner <00e4cf8f46a57000a44449bf9dd8cbbcc209fd2a@linutronix.de>

TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs