aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/libfc/fc_disc.c9
-rw-r--r--drivers/scsi/libfc/fc_rport.c4
2 files changed, 7 insertions, 6 deletions
diff --git a/drivers/scsi/libfc/fc_disc.c b/drivers/scsi/libfc/fc_disc.c
index e6b13bfecf73..266aa1ea01e4 100644
--- a/drivers/scsi/libfc/fc_disc.c
+++ b/drivers/scsi/libfc/fc_disc.c
@@ -377,12 +377,9 @@ static int fc_disc_new_target(struct fc_disc *disc,
377 ids->port_id != fc_host_port_id(lport->host) && 377 ids->port_id != fc_host_port_id(lport->host) &&
378 ids->port_name != lport->wwpn) { 378 ids->port_name != lport->wwpn) {
379 if (!rdata) { 379 if (!rdata) {
380 rdata = lport->tt.rport_lookup(lport, ids->port_id); 380 rdata = lport->tt.rport_create(lport, ids);
381 if (!rdata) { 381 if (!rdata)
382 rdata = lport->tt.rport_create(lport, ids); 382 error = -ENOMEM;
383 if (!rdata)
384 error = -ENOMEM;
385 }
386 } 383 }
387 if (rdata) { 384 if (rdata) {
388 rdata->ops = &fc_disc_rport_ops; 385 rdata->ops = &fc_disc_rport_ops;
diff --git a/drivers/scsi/libfc/fc_rport.c b/drivers/scsi/libfc/fc_rport.c
index a9087b31bce9..29bb6fd10036 100644
--- a/drivers/scsi/libfc/fc_rport.c
+++ b/drivers/scsi/libfc/fc_rport.c
@@ -98,6 +98,10 @@ static struct fc_rport_priv *fc_rport_create(struct fc_lport *lport,
98{ 98{
99 struct fc_rport_priv *rdata; 99 struct fc_rport_priv *rdata;
100 100
101 rdata = lport->tt.rport_lookup(lport, ids->port_id);
102 if (rdata)
103 return rdata;
104
101 rdata = kzalloc(sizeof(*rdata), GFP_KERNEL); 105 rdata = kzalloc(sizeof(*rdata), GFP_KERNEL);
102 if (!rdata) 106 if (!rdata)
103 return NULL; 107 return NULL;