]> git.proxmox.com Git - mirror_iproute2.git/commitdiff
rdma: Check that port index exists before operate on link layer
authorLeon Romanovsky <leonro@mellanox.com>
Wed, 27 Dec 2017 07:57:54 +0000 (09:57 +0200)
committerDavid Ahern <dsahern@gmail.com>
Wed, 27 Dec 2017 15:47:35 +0000 (07:47 -0800)
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@mellanox.com>
Signed-off-by: David Ahern <dsahern@gmail.com>
rdma/link.c

index f0eaccbb8be709578bc78597eebd348f4cda5188..d93922890bb7f1df34001f0c04ab18e7dbc4f412 100644 (file)
@@ -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");
 }