iproute/0005-rdma-Check-that-port-index-exists-before-operate-on-.patch
2018-02-09 18:20:31 +01:00

36 lines
951 B
Diff

From bde8ace828708b5d49ce650163c6a411065dafb4 Mon Sep 17 00:00:00 2001
From: Leon Romanovsky <leonro@mellanox.com>
Date: Wed, 27 Dec 2017 09:57:54 +0200
Subject: [PATCH 5/6] 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 <leonro@mellanox.com>
Signed-off-by: David Ahern <dsahern@gmail.com>
(cherry picked from commit e3dee3c81f7fba93ae8c84f6c2fb5009c0764d65)
Signed-off-by: Phil Sutter <psutter@redhat.com>
---
rdma/link.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/rdma/link.c b/rdma/link.c
index f0eaccbb8be70..d93922890bb7f 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