summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenoît Ganne <bganne@cisco.com>2019-10-07 15:36:10 +0200
committerDamjan Marion <dmarion@me.com>2019-10-07 20:01:48 +0000
commit0dd97d473bc0c958d9fcea508e1f5122a137b23f (patch)
tree24dd2cebba43c030ef7816d84b0adb9456f015ef
parent90ea5dc1bd7adcedd0d5765c3ee04c98c4853337 (diff)
rdma: fix crash when failing to read pci addr on create
Type: fix Change-Id: I543e2e5976cb384b81278a7ec98a0a6ab1612438 Signed-off-by: Benoît Ganne <bganne@cisco.com>
-rw-r--r--src/plugins/rdma/device.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/plugins/rdma/device.c b/src/plugins/rdma/device.c
index ea6d2785845..6c48a97f5bf 100644
--- a/src/plugins/rdma/device.c
+++ b/src/plugins/rdma/device.c
@@ -566,6 +566,9 @@ sysfs_path_to_pci_addr (char *path, vlib_pci_addr_t * addr)
u8 *s;
s = clib_sysfs_link_to_name (path);
+ if (!s)
+ return 0;
+
unformat_init_string (&in, (char *) s, strlen ((char *) s));
rv = unformat (&in, "%U", unformat_vlib_pci_addr, addr);
unformat_free (&in);