bus/vdev: allocate empty arguments string
authorJan Blunck <jblunck@infradead.org>
Tue, 11 Jul 2017 23:15:48 +0000 (19:15 -0400)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 12 Jul 2017 12:16:51 +0000 (14:16 +0200)
Signed-off-by: Jan Blunck <jblunck@infradead.org>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
lib/librte_eal/common/eal_common_vdev.c

index 5abdba0..e00dda9 100644 (file)
@@ -144,6 +144,8 @@ alloc_devargs(const char *name, const char *args)
        devargs->bus = &rte_vdev_bus;
        if (args)
                devargs->args = strdup(args);
+       else
+               devargs->args = strdup("");
 
        ret = snprintf(devargs->name, sizeof(devargs->name), "%s", name);
        if (ret < 0 || ret >= (int)sizeof(devargs->name)) {