diff mbox series

[7/9] scsi: bnx2fc: Add missing annotation for bnx2fc_abts_cleanup()

Message ID 20200411001933.10072-8-jbi.octave@gmail.com (mailing list archive)
State Accepted
Headers show
Series None | expand

Commit Message

Jules Irenge April 11, 2020, 12:19 a.m. UTC
Sparse reports a warning at bnx2fc_abts_cleanup()

warning: context imbalance in bnx2fc_abts_cleanup() - unexpected unlock

The root cause is the missing annotation at bnx2fc_abts_cleanup()

Add the missing  __must_hold(&tgt->tgt_lock) annotation

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
---
 drivers/scsi/bnx2fc/bnx2fc_io.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Martin K. Petersen April 24, 2020, 4:56 p.m. UTC | #1
Jules,

> Sparse reports a warning at bnx2fc_abts_cleanup()
>
> warning: context imbalance in bnx2fc_abts_cleanup() - unexpected unlock
>
> The root cause is the missing annotation at bnx2fc_abts_cleanup()
>
> Add the missing  __must_hold(&tgt->tgt_lock) annotation

Applied to 5.8/scsi-queue, thanks!
diff mbox series

Patch

diff --git a/drivers/scsi/bnx2fc/bnx2fc_io.c b/drivers/scsi/bnx2fc/bnx2fc_io.c
index 4c8122a82322..b45f40db9379 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_io.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_io.c
@@ -1081,6 +1081,7 @@  int bnx2fc_eh_device_reset(struct scsi_cmnd *sc_cmd)
 }
 
 static int bnx2fc_abts_cleanup(struct bnx2fc_cmd *io_req)
+	__must_hold(&tgt->tgt_lock)
 {
 	struct bnx2fc_rport *tgt = io_req->tgt;
 	unsigned int time_left;