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: da990ab40a ("rdma: Add link object")
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: David Ahern <dsahern@gmail.com>
This commit is contained in:
parent
4e2eb9fdf9
commit
e3dee3c81f
|
|
@ -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");
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue