summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerin Jacob <jerinj@marvell.com>2019-08-07 08:41:34 +0530
committerThomas Monjalon <thomas@monjalon.net>2019-08-07 10:21:33 +0200
commitde4473d911323ae1d26581c2f85abee5d1aaeb81 (patch)
tree4a3bcbd5161085bfe48f46e4170068880dac6a10
parent0710d87b7f5d0a2cd01861d44c4689efd4714b5f (diff)
downloaddpdk-de4473d911323ae1d26581c2f85abee5d1aaeb81.zip
dpdk-de4473d911323ae1d26581c2f85abee5d1aaeb81.tar.gz
dpdk-de4473d911323ae1d26581c2f85abee5d1aaeb81.tar.xz
net/memif: fix build with gcc 9.1
gcc-9 is stricter on NULL arguments for printf. Fix the following build error by avoiding NULL argument to printf. In file included from drivers/net/memif/memif_socket.c:26: In function 'memif_socket_create', inlined from 'memif_socket_init' at net/memif/memif_socket.c:965:12: net/memif/rte_eth_memif.h:35:2: error: '%s' directive argument is null [-Werror=format-overflow=] 35 | rte_log(RTE_LOG_ ## level, memif_logtype, \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 36 | "%s(): " fmt "\n", __func__, ##args) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Fixes: 09c7e63a71f9 ("net/memif: introduce memory interface PMD") Signed-off-by: Jerin Jacob <jerinj@marvell.com>
-rw-r--r--drivers/net/memif/memif_socket.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/memif/memif_socket.c b/drivers/net/memif/memif_socket.c
index 137033f..6740e34 100644
--- a/drivers/net/memif/memif_socket.c
+++ b/drivers/net/memif/memif_socket.c
@@ -918,7 +918,8 @@ memif_socket_create(struct pmd_internals *pmd, char *key, uint8_t listener)
error:
MIF_LOG(ERR, "%s: Failed to setup socket %s: %s",
- rte_vdev_device_name(pmd->vdev), key, strerror(errno));
+ rte_vdev_device_name(pmd->vdev) ?
+ rte_vdev_device_name(pmd->vdev) : "NULL", key, strerror(errno));
if (sock != NULL)
rte_free(sock);
if (sockfd >= 0)