summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Green <andy@warmcat.com>2018-05-14 13:04:43 +0800
committerThomas Monjalon <thomas@monjalon.net>2018-05-15 22:28:12 +0200
commit52f766443423a7728a9dedda13fd8b23d7e50665 (patch)
tree7272ab9f0c4e6f83cdbfdec1a894904b44a914ca
parentd9b8838ab2e90713827ee8843d836b0fccbaf2f7 (diff)
downloaddpdk-52f766443423a7728a9dedda13fd8b23d7e50665.zip
dpdk-52f766443423a7728a9dedda13fd8b23d7e50665.tar.gz
dpdk-52f766443423a7728a9dedda13fd8b23d7e50665.tar.xz
net/bnx2x: fix memzone name overrun
Fixes: 540a211084a7 ("bnx2x: driver core") Cc: stable@dpdk.org Signed-off-by: Andy Green <andy@warmcat.com> Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com> Acked-by: Rasesh Mody <rasesh.mody@cavium.com>
-rw-r--r--drivers/net/bnx2x/bnx2x.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/bnx2x/bnx2x.c b/drivers/net/bnx2x/bnx2x.c
index bfd9cce..3892934 100644
--- a/drivers/net/bnx2x/bnx2x.c
+++ b/drivers/net/bnx2x/bnx2x.c
@@ -170,10 +170,10 @@ bnx2x_dma_alloc(struct bnx2x_softc *sc, size_t size, struct bnx2x_dma *dma,
dma->sc = sc;
if (IS_PF(sc))
- sprintf(mz_name, "bnx2x%d_%s_%" PRIx64, SC_ABS_FUNC(sc), msg,
+ snprintf(mz_name, sizeof(mz_name), "bnx2x%d_%s_%" PRIx64, SC_ABS_FUNC(sc), msg,
rte_get_timer_cycles());
else
- sprintf(mz_name, "bnx2x%d_%s_%" PRIx64, sc->pcie_device, msg,
+ snprintf(mz_name, sizeof(mz_name), "bnx2x%d_%s_%" PRIx64, sc->pcie_device, msg,
rte_get_timer_cycles());
/* Caller must take care that strlen(mz_name) < RTE_MEMZONE_NAMESIZE */