|
@@ -624,11 +624,13 @@ static inline int cma_validate_port(struct ib_device *device, u8 port,
|
|
|
if ((dev_type != ARPHRD_INFINIBAND) && rdma_protocol_ib(device, port))
|
|
|
return ret;
|
|
|
|
|
|
- if (dev_type == ARPHRD_ETHER && rdma_protocol_roce(device, port))
|
|
|
+ if (dev_type == ARPHRD_ETHER && rdma_protocol_roce(device, port)) {
|
|
|
ndev = dev_get_by_index(&init_net, bound_if_index);
|
|
|
- else
|
|
|
+ if (!ndev)
|
|
|
+ return ret;
|
|
|
+ } else {
|
|
|
gid_type = IB_GID_TYPE_IB;
|
|
|
-
|
|
|
+ }
|
|
|
|
|
|
ret = ib_find_cached_gid_by_port(device, gid, gid_type, port,
|
|
|
ndev, NULL);
|