From: Bruce Richardson Date: Wed, 1 May 2019 19:50:13 +0000 (+0100) Subject: raw/skeleton: fix warnings with GCC 9 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=3a66890a8ada0a35f9292b1b6ce0326a5c3ce384;p=dpdk.git raw/skeleton: fix warnings with GCC 9 GCC9 gives warnings if the parameter passed to printf for "%s" could be NULL, so we need to add checks in some cases to ensure that is not the case. Fixes: 61c592a8d035 ("raw/skeleton: introduce skeleton rawdev driver") Cc: stable@dpdk.org Signed-off-by: Bruce Richardson --- diff --git a/drivers/raw/skeleton_rawdev/skeleton_rawdev.c b/drivers/raw/skeleton_rawdev/skeleton_rawdev.c index d7630fc698..63f2b9a092 100644 --- a/drivers/raw/skeleton_rawdev/skeleton_rawdev.c +++ b/drivers/raw/skeleton_rawdev/skeleton_rawdev.c @@ -705,6 +705,9 @@ skeleton_rawdev_probe(struct rte_vdev_device *vdev) name = rte_vdev_device_name(vdev); + if (name == NULL) + return -EINVAL; + /* More than one instance is not supported */ if (skeldev_init_once) { SKELETON_PMD_ERR("Multiple instance not supported for %s", @@ -740,6 +743,8 @@ skeleton_rawdev_remove(struct rte_vdev_device *vdev) int ret; name = rte_vdev_device_name(vdev); + if (name == NULL) + return -1; SKELETON_PMD_INFO("Closing %s on NUMA node %d", name, rte_socket_id());