scsi: scsi_debug: Fix qc_lock use in sdebug_blk_mq_poll()
authorDamien Le Moal <damien.lemoal@opensource.wdc.com>
Tue, 1 Mar 2022 11:30:09 +0000 (20:30 +0900)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 9 Mar 2022 03:30:34 +0000 (22:30 -0500)
commit3fd07aecb75003fbcb0b7c3124d12f71ffd360d8
tree991093093f66841928be7aec0c050332b9b4e8f5
parente9c478014b602fda2a99a6370d9eb2e5d7355246
scsi: scsi_debug: Fix qc_lock use in sdebug_blk_mq_poll()

The use of the 'locked' boolean variable to control locking and unlocking
of the qc_lock spinlock of struct sdebug_queue confuses sparse, leading to
a warning about an unexpected unlock. Simplify the qc_lock lock/unlock
handling code of this function to avoid this warning by removing the
'locked' boolean variable. This change also fixes unlocked access to the
in_use_bm bitmap with the find_first_bit() function.

Link: https://lore.kernel.org/r/20220301113009.595857-3-damien.lemoal@opensource.wdc.com
Fixes: b05d4e481eff ("scsi: scsi_debug: Refine sdebug_blk_mq_poll()")
Cc: stable@vger.kernel.org
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/scsi_debug.c