]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit7786ee7d912de35a9f7c26995e10b8ff05344023
treead391ce2c50619edb86e197d51b62c5234e3b50f
parenta516a020322f282e00519cc72bf6de52e0a86ef0
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