Skip to contentSkip to conversation

scsi: mpi3mr: unlock on error path

PATCH Applied Dan Carpenter 2 participants 3 messages Jul 18, 2022 – Jul 27, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi: mpi3mr: unlock on error path

There is some clean up necessary before returning. Smatch complains:

    drivers/scsi/mpi3mr/mpi3mr_fw.c:4786 mpi3mr_soft_reset_handler()
    warn: inconsistent returns '&mrioc->reset_mutex'.
      Locked on  : 4730
      Unlocked on: 4786
Fixes fded192f1303 ("scsi: mpi3mr: Resource Based Metering")
---
 drivers/scsi/mpi3mr/mpi3mr_fw.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/scsi/mpi3mr/mpi3mr_fw.c +2 -1
index 6e39f7969e63..0866dfd43318 100644
@@ -4727,7 +4727,8 @@ int mpi3mr_soft_reset_handler(struct mpi3mr_ioc *mrioc,
 		    "max io throttle group doesn't match old(%d), new(%d)\n",
 		    mrioc->num_io_throttle_group,
 		    mrioc->facts.max_io_throttle_group);
-		return -EPERM;
+		retval = -EPERM;
+		goto out;
 	}
 
 	mpi3mr_flush_delayed_cmd_lists(mrioc);
Signature · 1 line
2.35.1
#1 lore raw

Dan,

Quoted 6 lines

There is some clean up necessary before returning. Smatch complains:

    drivers/scsi/mpi3mr/mpi3mr_fw.c:4786 mpi3mr_soft_reset_handler()
    warn: inconsistent returns '&mrioc->reset_mutex'.
      Locked on  : 4730
      Unlocked on: 4786

Applied to 5.20/scsi-staging, thanks!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering
#2 lore raw
In reply to Dan Carpenter
Quoted 8 lines · Dan Carpenter

There is some clean up necessary before returning. Smatch complains:

    drivers/scsi/mpi3mr/mpi3mr_fw.c:4786 mpi3mr_soft_reset_handler()
    warn: inconsistent returns '&mrioc->reset_mutex'.
      Locked on  : 4730
      Unlocked on: 4786

[...]

Applied to 5.20/scsi-queue, thanks!

[1/1] scsi: mpi3mr: unlock on error path

      https://git.kernel.org/mkp/scsi/c/2a8a0147cb52
Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering