Skip to content

Commit

Permalink
scsi: qedf: Simplify mutex_unlock() usage
Browse files Browse the repository at this point in the history
The commit 6d1368e ("scsi: qedf: fixup locking in
qedf_restart_rport()") introduced the lock. Though the lock protects
only the fc_rport_create() call. Thus, we can move the mutex unlock up
before the if statement and drop the else body.

Link: https://lore.kernel.org/r/[email protected]
Cc: Hannes Reinecke <[email protected]>
Cc: Saurav Kashyap <[email protected]>
Signed-off-by: Daniel Wagner <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
  • Loading branch information
igaw authored and martinkpetersen committed Apr 14, 2020
1 parent 4e2dec6 commit fbbef0d
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions drivers/scsi/qedf/qedf_els.c
Original file line number Diff line number Diff line change
Expand Up @@ -388,14 +388,10 @@ void qedf_restart_rport(struct qedf_rport *fcport)
mutex_lock(&lport->disc.disc_mutex);
/* Recreate the rport and log back in */
rdata = fc_rport_create(lport, port_id);
if (rdata) {
mutex_unlock(&lport->disc.disc_mutex);
mutex_unlock(&lport->disc.disc_mutex);
if (rdata)
fc_rport_login(rdata);
fcport->rdata = rdata;
} else {
mutex_unlock(&lport->disc.disc_mutex);
fcport->rdata = NULL;
}
fcport->rdata = rdata;
}
clear_bit(QEDF_RPORT_IN_RESET, &fcport->flags);
}
Expand Down

0 comments on commit fbbef0d

Please sign in to comment.