diff options
author | Benoît Ganne <bganne@cisco.com> | 2019-10-07 15:36:10 +0200 |
---|---|---|
committer | Andrew Yourtchenko <ayourtch@gmail.com> | 2019-10-15 10:46:04 +0000 |
commit | 8a7109cc6e61f9ed4677bf114466ba14e82dee71 (patch) | |
tree | c02697d9cb5980e94f606d924f8d22e45004e610 /src | |
parent | 8413f48d6edc114cd8d88f0dedec48e7a414cc1e (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>
(cherry picked from commit 0dd97d473bc0c958d9fcea508e1f5122a137b23f)
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/rdma/device.c | 3 |
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); |