Skip to contentSkip to conversation

fnic: potential dead lock in fnic_is_abts_pending()

PATCH In review Dan Carpenter 2 participants 2 messages May 30, 2013 – Jun 4, 2013

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

PATCH 1/1 fnic: potential dead lock in fnic_is_abts_pending()

There is an unlock missing if the = FNIC_IOREQ_ABTS_PENDING is false.

---
Static analysis. I can't test this.

drivers/scsi/fnic/fnic_scsi.c +2 -4
index be99e75..a97e6e5 100644
@@ -2432,11 +2432,9 @@ int fnic_is_abts_pending(struct fnic *fnic, struct scsi_cmnd *lr_sc)
 			      "Found IO in %s on lun\n",
 			      fnic_ioreq_state_to_str(CMD_STATE(sc)));
 
-		if (CMD_STATE(sc) = FNIC_IOREQ_ABTS_PENDING) {
-			spin_unlock_irqrestore(io_lock, flags);
+		if (CMD_STATE(sc) = FNIC_IOREQ_ABTS_PENDING)
 			ret = 1;
-			continue;
-		}
+		spin_unlock_irqrestore(io_lock, flags);
 	}
 
 	return ret;
Tested-by Acked-by on v1 1/1
#1 lore raw
Quoted 25 lines · Dan Carpenter

There is an unlock missing if the = FNIC_IOREQ_ABTS_PENDING is false.

---
Static analysis. I can't test this.

drivers/scsi/fnic/fnic_scsi.c +2 -4
index be99e75..a97e6e5 100644
@@ -2432,11 +2432,9 @@ int fnic_is_abts_pending(struct fnic *fnic, struct
 scsi_cmnd *lr_sc)
 			      "Found IO in %s on lun\n",
 			      fnic_ioreq_state_to_str(CMD_STATE(sc)));
 
-		if (CMD_STATE(sc) = FNIC_IOREQ_ABTS_PENDING) {
-			spin_unlock_irqrestore(io_lock, flags);
+		if (CMD_STATE(sc) = FNIC_IOREQ_ABTS_PENDING)
 			ret = 1;
-			continue;
-		}
+		spin_unlock_irqrestore(io_lock, flags);
 	}
 
Quoted 1 line
	return ret;