aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/infiniband/core/cma.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
index a7568c34a1aa..d789eea32168 100644
--- a/drivers/infiniband/core/cma.c
+++ b/drivers/infiniband/core/cma.c
@@ -345,17 +345,17 @@ static int find_gid_port(struct ib_device *device, union ib_gid *gid, u8 port_nu
345 345
346 err = ib_query_port(device, port_num, &props); 346 err = ib_query_port(device, port_num, &props);
347 if (err) 347 if (err)
348 return 1; 348 return err;
349 349
350 for (i = 0; i < props.gid_tbl_len; ++i) { 350 for (i = 0; i < props.gid_tbl_len; ++i) {
351 err = ib_query_gid(device, port_num, i, &tmp); 351 err = ib_query_gid(device, port_num, i, &tmp);
352 if (err) 352 if (err)
353 return 1; 353 return err;
354 if (!memcmp(&tmp, gid, sizeof tmp)) 354 if (!memcmp(&tmp, gid, sizeof tmp))
355 return 0; 355 return 0;
356 } 356 }
357 357
358 return -EAGAIN; 358 return -EADDRNOTAVAIL;
359} 359}
360 360
361static int cma_acquire_dev(struct rdma_id_private *id_priv) 361static int cma_acquire_dev(struct rdma_id_private *id_priv)
@@ -388,8 +388,7 @@ static int cma_acquire_dev(struct rdma_id_private *id_priv)
388 if (!ret) { 388 if (!ret) {
389 id_priv->id.port_num = port; 389 id_priv->id.port_num = port;
390 goto out; 390 goto out;
391 } else if (ret == 1) 391 }
392 break;
393 } 392 }
394 } 393 }
395 } 394 }