From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 679F3A0C4B for ; Thu, 17 Jun 2021 16:18:00 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5FAD2410FE; Thu, 17 Jun 2021 16:18:00 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id ADD7A410E8; Thu, 17 Jun 2021 16:17:57 +0200 (CEST) IronPort-SDR: n0ag50JF5XrB7HgOn0dLjSwGfHRYQt5uhixQFwiIF7UndpZkvi0A+DgrNj2YMr3+2XxGjnQqjR MrsUBIXwa5Fw== X-IronPort-AV: E=McAfee;i="6200,9189,10017"; a="193691261" X-IronPort-AV: E=Sophos;i="5.83,280,1616482800"; d="scan'208";a="193691261" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jun 2021 07:17:56 -0700 IronPort-SDR: HP5S/nbnVUqQ+Jh3J52VMggE2l+KWJg+6ga2x83F3qAQLeTGNyT1+d5AWsnG5LjqjPlKbadrAD hGlIYCKdEQ9g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,280,1616482800"; d="scan'208";a="451032201" Received: from silpixa00401122.ir.intel.com ([10.55.128.10]) by orsmga008.jf.intel.com with ESMTP; 17 Jun 2021 07:17:55 -0700 From: Kevin Laatz To: dev@dpdk.org Cc: stable@dpdk.org, bruce.richardson@intel.com, Kevin Laatz Date: Thu, 17 Jun 2021 14:17:52 +0000 Message-Id: <20210617141752.93312-1-kevin.laatz@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] [PATCH] raw/ioat: fix memory leak in device configure X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" During device configure, memory is allocated for "hdl_ring_flags". In the event of another call to the device configure function (reconfigure), a memory leak would occur. This patch fixes the memory leak by free'ing the memory before reallocating it. Fixes: 245efe544d8e ("raw/ioat: report status of completed jobs") Signed-off-by: Kevin Laatz --- drivers/raw/ioat/ioat_common.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/raw/ioat/ioat_common.c b/drivers/raw/ioat/ioat_common.c index d01c1ee367..f4771745cc 100644 --- a/drivers/raw/ioat/ioat_common.c +++ b/drivers/raw/ioat/ioat_common.c @@ -147,6 +147,7 @@ idxd_dev_configure(const struct rte_rawdev *dev, /* in case we are reconfiguring a device, free any existing memory */ rte_free(rte_idxd->desc_ring); rte_free(rte_idxd->hdl_ring); + rte_free(rte_idxd->hdl_ring_flags); /* allocate the descriptor ring at 2x size as batches can't wrap */ rte_idxd->desc_ring = rte_zmalloc(NULL, -- 2.25.1