From: Leon Romanovsky <leo...@mellanox.com>

Link layer operates on port layer, hence it should check
it existence before execution commands.

Fixes: da990ab40a92 ("rdma: Add link object")
Signed-off-by: Leon Romanovsky <leo...@mellanox.com>
---
 rdma/link.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/rdma/link.c b/rdma/link.c
index f0eaccbb..d9392289 100644
--- a/rdma/link.c
+++ b/rdma/link.c
@@ -277,6 +277,9 @@ static int link_one_show(struct rd *rd)
                { 0 }
        };
 
+       if (!rd->port_idx)
+               return 0;
+
        return rd_exec_cmd(rd, cmds, "parameter");
 }
 
-- 
2.15.1

Reply via email to