Skip to contentSkip to conversation

ibmvfc: prevent a potential deadlock

PATCH Applied Dan Carpenter 4 participants 4 messages Jul 15, 2016

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

PATCH 1/1 ibmvfc: prevent a potential deadlock

My static checker complains that we need to unlock on this path. Seems true.

drivers/scsi/ibmvscsi/ibmvfc.c +2 -0
index fc523c3..ab67ec4 100644
@@ -4722,6 +4722,8 @@ static void ibmvfc_rport_add_thread(struct work_struct *work)
 					tgt_dbg(tgt, "Setting rport roles\n");
 					fc_remote_port_rolechg(rport, tgt->ids.roles);
 					put_device(&rport->dev);
+				} else {
+					spin_unlock_irqrestore(vhost->host->host_lock, flags);
 				}
 
 				kref_put(&tgt->kref, ibmvfc_release_tgt);
Reviewed-by on v1 1/1
#2 lore raw
In reply to Dan Carpenter
Quoted 10 lines · Dan Carpenter

My static checker complains that we need to unlock on this path. Seems true.

drivers/scsi/ibmvscsi/ibmvfc.c +0 -0
index fc523c3..ab67ec4 100644

drivers/scsi/ibmvscsi/ibmvfc.c static void ibmvfc_rport_add_thread(struct work_struct *work)

Quoted 9 lines
drivers/scsi/ibmvscsi/ibmvfc.c +2 -1
@@ -4722,6 +4722,8 @@ static void ibmvfc_rport_add_thread(struct work_struct *work)
 					tgt_dbg(tgt, "Setting rport roles\n");
 					fc_remote_port_rolechg(rport, tgt->ids.roles);
 					put_device(&rport->dev);
+				} else {
+					spin_unlock_irqrestore(vhost->host->host_lock, flags);
 				}
 
 				kref_put(&tgt->kref, ibmvfc_release_tgt);
--
#3 lore raw
In reply to Dan Carpenter
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Dan" = Dan Carpenter <[email protected]> writes:

Dan> My static checker complains that we need to unlock on this path. Dan> Seems true.

Applied to 4.8/scsi-queue.

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering