scsi: lpfc: Correct nvmet buffer free race condition
authorJames Smart <jsmart2021@gmail.com>
Wed, 22 May 2019 00:48:53 +0000 (17:48 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 18 Jun 2019 23:46:20 +0000 (19:46 -0400)
commit4767c58af96e1c6a2dad307c6e5bb75d6c646815
tree97f9778530e693bb96b473c59bbb134185b40847
parent32b938656462dd2c4aa1e91e0b48cd114c2d00f7
scsi: lpfc: Correct nvmet buffer free race condition

A race condition resulted in receive buffers being placed in the free list
twice.

Change the locking and handling to check whether the "other" path will be
freeing the entry in a later thread and skip it if it is.

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/lpfc/lpfc_nvmet.c