ibmvfc: prevent a potential deadlock
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 15 Jul 2016 11:18:57 +0000 (14:18 +0300)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 15 Jul 2016 19:13:52 +0000 (15:13 -0400)
My static checker complains that we need to unlock on this path.  Seems
true.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Brian King <brking@linux.vnet.ibm.com>
Reviewed-by: Ewan D. Milne <emilne@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/ibmvscsi/ibmvfc.c

index fc523c3e50191a428d0125d948d9e2447ce6e53f..ab67ec4b6bd632587e18bccc30ae72dceb8fdfd8 100644 (file)
@@ -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);