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 B1938A034E; Tue, 22 Feb 2022 19:18:52 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5472C4115D; Tue, 22 Feb 2022 19:18:44 +0100 (CET) Received: from out203-205-221-192.mail.qq.com (out203-205-221-192.mail.qq.com [203.205.221.192]) by mails.dpdk.org (Postfix) with ESMTP id 4491E41151 for ; Tue, 22 Feb 2022 19:18:40 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1645553919; bh=SxTbALdmkFJJ5so20iB17BPhK/GAFWaxv5TFPABCRRY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=OfxN0utmt39DYwwzLXWM7vDOC04c8bQig5/B+Xum1RuQilueGjqAAYir+520ttDuz qkwurLf7K1Ty4Ra0EZE47s0onwjIWPez9eBKVZqiTBZWg4OBlS8+gb0K1qrb6nh+F2 2Te3IQWA2G00AUdFQP9tUfbLkaxKDd2Musb48Lpo= Received: from localhost.localdomain ([111.193.130.237]) by newxmesmtplogicsvrszc6.qq.com (NewEsmtp) with SMTP id 49223207; Wed, 23 Feb 2022 02:18:18 +0800 X-QQ-mid: xmsmtpt1645553915tdmu863dm Message-ID: X-QQ-XMAILINFO: NFNrK8KlcSCRbUxslsI/YyyJPNrZRnRRM6ACClCUtbnl94lUi4m/j916j7SPE2 UC/vH+UOWfmDtbWdDR0fND8FNC2LfSSCT8wbSjECl0ZUDkoJrdT/h4UPpHIDroQPmKyuzMTbVr4E 7gE1H38YveQWrsRPoak6VJbpymScw0g8sjkqcFrsdXBDFfBgMkNL9w/ii79k2HYM52IC1EILrWkU fL+cA6xz2b6rPS/flAhzJMXarw99JPRt4XkWQ8ip4YreTIllaXomgdVAjUAmfms4biCaFNPVlcQe mYhUATZdlJbCkJ3WgZZIesSk1a/S+rkDzaLpYROtcpazDEdV7oTwxHIdTW67Rdbur1cBHPr7seOk foFcElDWb1frbEbb2eaDz71xd+SzgIAQKsbVsI1F1nGSjNzL+lVeSiwJnrmjMTOqpt8++m8KS73N ujgPOjQOBX0U1wuiJ7STZTUL9sKdEWuao25N8IFRzP3tTCG3XFia8ToBu3GqN0OfenjJhPihZS4C SfQLy14kWpPOI42y1XyZjSHWkL86x3tyq595mOFJq1uzUwCZb9tk6SsVDfGnEokzfUi9uJN9Awxq 7mTlMKMhKhmDHkCwj7pXGDAaVNeYE6+TwuUoEf2deCZGqI3SrJvv3egIdPpr3o2AGnOcKJejUzT6 IKzztR6vV4XIKlzBDcuDCxEH0zJj1zHDRVFNfBooCc8gBCOlGMz3gPTwePMtXSVuQoe+EYpUyQMu xHUedaJovkggPaHh2ij1IIBHVcAd4JsGArlHkjWxJAzkhlTzY0T58zFI56RkNMQWuUO8YVZJn3Qh QoxY+i+AXegHtixcKyGpu0JEgRo4Z4+pa7sFXJ/VXy8VMNlL+3goeOjGWwSnVgwvMurli2eWEzVf PkK+eCVSVxqxEwTZrPg0U= From: Weiguo Li To: dev@dpdk.org Cc: adypodoman@gmail.com, xiaoyun.li@intel.com, tianfei.zhang@intel.com, bruce.richardson@intel.com, ivan.malov@oktetlabs.ru, jgrajcia@cisco.com, hkalra@marvell.com, ying.a.wang@intel.com, ting.xu@intel.com, simei.su@intel.com, qiming.yang@intel.com, motih@mellanox.com, shreyansh.jain@nxp.com, skoteshwar@marvell.com, stephen@networkplumber.org, kalesh-anakkur.purayil@broadcom.com, somnath.kotur@broadcom.com, declan.doherty@intel.com, gakhil@marvell.com, nicolas.chautru@intel.com Subject: [PATCH 03/20] crypto/dpaa2_sec: fix memory leaks in error handlings Date: Wed, 23 Feb 2022 02:18:01 +0800 X-OQ-MSGID: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org When function returned from error handling branches, the memories were not freed which caused a memory leak. Fixes: 8d1f3a5d751b ("crypto/dpaa2_sec: support crypto operation") Signed-off-by: Weiguo Li --- drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c index e62d04852b..3f8d4d213f 100644 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c @@ -2037,12 +2037,15 @@ dpaa2_sec_queue_pair_setup(struct rte_cryptodev *dev, uint16_t qp_id, RTE_CACHE_LINE_SIZE); if (!qp->rx_vq.q_storage) { DPAA2_SEC_ERR("malloc failed for q_storage"); + rte_free(qp); return -ENOMEM; } memset(qp->rx_vq.q_storage, 0, sizeof(struct queue_storage_info_t)); if (dpaa2_alloc_dq_storage(qp->rx_vq.q_storage)) { DPAA2_SEC_ERR("Unable to allocate dequeue storage"); + rte_free(qp->rx_vq.q_storage); + rte_free(qp); return -ENOMEM; } -- 2.25.1