summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Smart <james.smart@avagotech.com>2015-05-21 20:55:19 +0300
committerJames Bottomley <JBottomley@Odin.com>2015-06-06 01:31:21 +0300
commit7aafb6e75e0212b5aa5b1f79737e6e8de40b1132 (patch)
tree936991f43515f6e46ff806044b2a9bc9f655cbd8
parent8b017a30a31390bf7968d60e408f2d38fc7bd254 (diff)
downloadlinux-7aafb6e75e0212b5aa5b1f79737e6e8de40b1132.tar.xz
lpfc: Correct reference counting of rport
Signed-off-by: Dick Kennedy <dick.kennedy@avagotech.com> Signed-off-by: James Smart <james.smart@avagotech.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
-rw-r--r--drivers/scsi/lpfc/lpfc_hbadisc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c
index 72388a6ec5d5..e93705da81b4 100644
--- a/drivers/scsi/lpfc/lpfc_hbadisc.c
+++ b/drivers/scsi/lpfc/lpfc_hbadisc.c
@@ -161,7 +161,8 @@ lpfc_dev_loss_tmo_callbk(struct fc_rport *rport)
ndlp->rport = NULL;
if (put_node)
lpfc_nlp_put(ndlp);
- put_device(&rport->dev);
+ if (put_rport)
+ put_device(&rport->dev);
return;
}