diff mbox series

scsi: fnic: unlock on error path in fnic_queuecommand()

Message ID 5360fa20-74bc-4c22-a78e-ea8b18c5410d@moroto.mountain
State New
Headers show
Series scsi: fnic: unlock on error path in fnic_queuecommand() | expand

Commit Message

Dan Carpenter Jan. 10, 2024, 6:41 p.m. UTC
Call spin_unlock_irqrestore(&fnic->wq_copy_lock[hwq], flags) before
returning.

Fixes: c81df08cd294 ("scsi: fnic: Add support for multiqueue (MQ) in fnic driver")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
 drivers/scsi/fnic/fnic_scsi.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Karan Tilak Kumar (kartilak) Jan. 12, 2024, 2:14 a.m. UTC | #1
On Wednesday, January 10, 2024 10:42 AM, Dan Carpenter <dan.carpenter@linaro.org> wrote:
>
> Call spin_unlock_irqrestore(&fnic->wq_copy_lock[hwq], flags) before
> returning.
>
> Fixes: c81df08cd294 ("scsi: fnic: Add support for multiqueue (MQ) in fnic driver")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
> drivers/scsi/fnic/fnic_scsi.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/scsi/fnic/fnic_scsi.c b/drivers/scsi/fnic/fnic_scsi.c
> index 4d6db4509e75..8d7fc5284293 100644
> --- a/drivers/scsi/fnic/fnic_scsi.c
> +++ b/drivers/scsi/fnic/fnic_scsi.c
> @@ -546,6 +546,7 @@ int fnic_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *sc)
> if (fnic->sw_copy_wq[hwq].io_req_table[blk_mq_unique_tag_to_tag(mqtag)] != NULL) {
> WARN(1, "fnic<%d>: %s: hwq: %d tag 0x%x already exists\n",
> fnic->fnic_num, __func__, hwq, blk_mq_unique_tag_to_tag(mqtag));
> +             spin_unlock_irqrestore(&fnic->wq_copy_lock[hwq], flags);
> return SCSI_MLQUEUE_HOST_BUSY;
> }
>
> --
> 2.42.0
>
>

Thanks for your change, Dan.
Looks good to me.

Reviewed-by: Karan Tilak Kumar <kartilak@cisco.com>

Regards,
Karan
Martin K. Petersen Jan. 12, 2024, 2:35 a.m. UTC | #2
Dan,

> Call spin_unlock_irqrestore(&fnic->wq_copy_lock[hwq], flags) before
> returning.

Applied to 6.8/scsi-staging, thanks!
Martin K. Petersen Jan. 17, 2024, 8:10 p.m. UTC | #3
On Wed, 10 Jan 2024 21:41:55 +0300, Dan Carpenter wrote:

> Call spin_unlock_irqrestore(&fnic->wq_copy_lock[hwq], flags) before
> returning.
> 
> 

Applied to 6.8/scsi-queue, thanks!

[1/1] scsi: fnic: unlock on error path in fnic_queuecommand()
      https://git.kernel.org/mkp/scsi/c/38945c2b006b
diff mbox series

Patch

diff --git a/drivers/scsi/fnic/fnic_scsi.c b/drivers/scsi/fnic/fnic_scsi.c
index 4d6db4509e75..8d7fc5284293 100644
--- a/drivers/scsi/fnic/fnic_scsi.c
+++ b/drivers/scsi/fnic/fnic_scsi.c
@@ -546,6 +546,7 @@  int fnic_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *sc)
 	if (fnic->sw_copy_wq[hwq].io_req_table[blk_mq_unique_tag_to_tag(mqtag)] != NULL) {
 		WARN(1, "fnic<%d>: %s: hwq: %d tag 0x%x already exists\n",
 				fnic->fnic_num, __func__, hwq, blk_mq_unique_tag_to_tag(mqtag));
+		spin_unlock_irqrestore(&fnic->wq_copy_lock[hwq], flags);
 		return SCSI_MLQUEUE_HOST_BUSY;
 	}