From patchwork Mon May 14 05:04:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Green X-Patchwork-Id: 39957 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 136901C677; Mon, 14 May 2018 07:04:49 +0200 (CEST) Received: from mail.warmcat.com (mail.warmcat.com [163.172.24.82]) by dpdk.org (Postfix) with ESMTP id 807B97DEC for ; Mon, 14 May 2018 07:04:47 +0200 (CEST) From: Andy Green To: dev@dpdk.org Date: Mon, 14 May 2018 13:04:43 +0800 Message-ID: <152627428369.53058.11097988033304615943.stgit@localhost.localdomain> In-Reply-To: <152627420173.53058.13179290989817984940.stgit@localhost.localdomain> References: <152627420173.53058.13179290989817984940.stgit@localhost.localdomain> User-Agent: StGit/unknown-version Subject: [dpdk-dev] [PATCH v3 4/4] net/bnx2x: solve overruns X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Signed-off-by: Andy Green Fixes: 540a211084a7 ("bnx2x: driver core") Cc: stable@dpdk.org Acked-by: Pablo de Lara Acked-by: Rasesh Mody --- drivers/net/bnx2x/bnx2x.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/bnx2x/bnx2x.c b/drivers/net/bnx2x/bnx2x.c index bfd9cce51..3892934cc 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 */