From: Leon Romanovsky Date: Wed, 27 Dec 2017 07:57:54 +0000 (+0200) Subject: rdma: Check that port index exists before operate on link layer X-Git-Tag: v4.16.0~96 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e3dee3c81f7fba93ae8c84f6c2fb5009c0764d65;p=thirdparty%2Fiproute2.git rdma: Check that port index exists before operate on link layer 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 Signed-off-by: David Ahern --- diff --git a/rdma/link.c b/rdma/link.c index f0eaccbb8..d93922890 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"); }