Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

bfa: allocate memory with GFP_ATOMIC in spinlock context

bfa_fcb_pbc_vport_create() is called only from bfa_fcs_pbc_vport_init(),
that is called only from bfad_drv_start() with bfad_lock spinlock held.
So the patch replaces GFP_KERNEL with GFP_ATOMIC to avoid
sleeping in atomic spinlock context.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Acked-by: Anil Gurumurthy <anil.gurumurthy@qlogic.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>

authored by

Alexey Khoroshilov and committed by
Christoph Hellwig
dc6d2a0f 248c9fb0

+1 -1
+1 -1
drivers/scsi/bfa/bfad.c
··· 507 507 struct bfad_vport_s *vport; 508 508 int rc; 509 509 510 - vport = kzalloc(sizeof(struct bfad_vport_s), GFP_KERNEL); 510 + vport = kzalloc(sizeof(struct bfad_vport_s), GFP_ATOMIC); 511 511 if (!vport) { 512 512 bfa_trc(bfad, 0); 513 513 return;