Skip to content

Commit

Permalink
bfa: allocate memory with GFP_ATOMIC in spinlock context
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Anil Gurumurthy <[email protected]>
Signed-off-by: Christoph Hellwig <[email protected]>
  • Loading branch information
khoroshilov authored and Christoph Hellwig committed May 19, 2014
1 parent 248c9fb commit dc6d2a0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/scsi/bfa/bfad.c
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ bfa_fcb_pbc_vport_create(struct bfad_s *bfad, struct bfi_pbc_vport_s pbc_vport)
struct bfad_vport_s *vport;
int rc;

vport = kzalloc(sizeof(struct bfad_vport_s), GFP_KERNEL);
vport = kzalloc(sizeof(struct bfad_vport_s), GFP_ATOMIC);
if (!vport) {
bfa_trc(bfad, 0);
return;
Expand Down

0 comments on commit dc6d2a0

Please sign in to comment.