Skip to contentSkip to conversation

libfc: unlocking wrong lock in fc_eh_abort()

PATCH In review Dan Carpenter 2 participants 2 messages Nov 18, 2010

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

PATCH 1/1 libfc: unlocking wrong lock in fc_eh_abort()

In commit 8b7ac2bb07bb "[SCSI] libfc: possible race could panic system due to NULL fsp->cmd" we changed the lock which was used in this function, but this path was missed.

---
This is a static checker fix. Compile tested only.

drivers/scsi/libfc/fc_fcp.c +1 -1
index 2924363..b9ad74d 100644
@@ -2004,7 +2004,7 @@ int fc_eh_abort(struct scsi_cmnd *sc_cmd)
 	fsp = CMD_SP(sc_cmd);
 	if (!fsp) {
 		/* command completed while scsi eh was setting up */
-		spin_unlock_irqrestore(lport->host->host_lock, flags);
+		spin_unlock_irqrestore(&si->scsi_queue_lock, flags);
 		return SUCCESS;
 	}
 	/* grab a ref so the fsp and sc_cmd cannot be relased from under us */
#1 lore raw
Quoted 5 lines · Dan Carpenter

In commit 8b7ac2bb07bb "[SCSI] libfc: possible race could panic system due to NULL fsp->cmd" we changed the lock which was used in this function, but this path was missed.

Hi Dan,

I found this bug too and have a patch in my tree.

Thanks, //Rob