[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20171227075759.15289-6-leon@kernel.org>
Date: Wed, 27 Dec 2017 09:57:54 +0200
From: Leon Romanovsky <leon@...nel.org>
To: David Ahern <dsahern@...il.com>
Cc: Leon Romanovsky <leonro@...lanox.com>,
netdev <netdev@...r.kernel.org>,
Stephen Hemminger <stephen@...workplumber.org>
Subject: [PATCH iproute2-next 05/10] rdma: Check that port index exists before operate on link layer
From: Leon Romanovsky <leonro@...lanox.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 <leonro@...lanox.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
Powered by blists - more mailing lists