powerpc/pseries: avoid blocking in irq when queuing hotplug events
authorNathan Lynch <nathanl@linux.ibm.com>
Tue, 28 May 2019 23:28:01 +0000 (18:28 -0500)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 19 Jun 2019 10:05:08 +0000 (20:05 +1000)
commit348ea30f51fc63ce3c7fd7dba6043e8e3ee0ef34
treead391ce2c50619edb86e197d51b62c5234e3b50f
parentf474c28fbcbe42faca4eb415172c07d76adcb819
powerpc/pseries: avoid blocking in irq when queuing hotplug events

A couple of bugs in queue_hotplug_event():

1. Unchecked kmalloc result which could lead to an oops.
2. Use of GFP_KERNEL allocations in interrupt context (this code's
   only caller is ras_hotplug_interrupt()).

Use kmemdup to avoid open-coding the allocation+copy and check for
failure; use GFP_ATOMIC for both allocations.

Ultimately it probably would be better to avoid or reduce allocations
in this path if possible.

Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/platforms/pseries/dlpar.c