summaryrefslogtreecommitdiffstats
path: root/src/plugins/dpdk/device
diff options
context:
space:
mode:
authorBenoît Ganne <bganne@cisco.com>2021-10-13 11:35:15 +0200
committerDamjan Marion <dmarion@me.com>2021-10-13 14:31:28 +0000
commit82f618c35f4a7182a98fda69fa07f2335a7d03ea (patch)
tree3dfc47951ef91e90e72cbd9a83d378093655566d /src/plugins/dpdk/device
parent2dfeef522c1969d549dc0093a802f3cb5affee9f (diff)
dpdk: fix vmbus device name parsing
unformat_init_vector() expects a vector, not a NULL-terminated C-string. Type: fix Change-Id: I20a266243f63d94b0c6fe24e25ee8346c08c8ff2 Signed-off-by: Benoît Ganne <bganne@cisco.com>
Diffstat (limited to 'src/plugins/dpdk/device')
-rw-r--r--src/plugins/dpdk/device/init.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/plugins/dpdk/device/init.c b/src/plugins/dpdk/device/init.c
index b64f76bf185..f9927dbeebc 100644
--- a/src/plugins/dpdk/device/init.c
+++ b/src/plugins/dpdk/device/init.c
@@ -287,14 +287,15 @@ dpdk_lib_init (dpdk_main_t * dm)
if (vmbus_dev)
{
unformat_input_t input_vmbus;
-
- unformat_init_vector (&input_vmbus, (u8 *) dev_info.device->name);
+ unformat_init_string (&input_vmbus, dev_info.device->name,
+ strlen (dev_info.device->name));
if (unformat (&input_vmbus, "%U", unformat_vlib_vmbus_addr,
&vmbus_addr))
{
p = mhash_get (&dm->conf->device_config_index_by_vmbus_addr,
&vmbus_addr);
}
+ unformat_free (&input_vmbus);
}
if (p)