From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 92B74A04B1 for ; Tue, 29 Sep 2020 15:46:55 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C05771B68E; Tue, 29 Sep 2020 15:46:43 +0200 (CEST) Received: from huawei.com (szxga07-in.huawei.com [45.249.212.35]) by dpdk.org (Postfix) with ESMTP id D0F551D6AA; Tue, 29 Sep 2020 15:46:40 +0200 (CEST) Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id BFEBD88F94C58743DE33; Tue, 29 Sep 2020 21:46:39 +0800 (CST) Received: from localhost (10.174.185.168) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.487.0; Tue, 29 Sep 2020 21:46:33 +0800 From: wangyunjian To: CC: , , , Yunjian Wang , Date: Tue, 29 Sep 2020 21:46:33 +0800 Message-ID: X-Mailer: git-send-email 1.9.5.msysgit.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.174.185.168] X-CFilter-Loop: Reflected Subject: [dpdk-stable] [dpdk-dev] [PATCH] eventdev: fix adapter leak in error path X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 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" From: Yunjian Wang In rte_event_crypto_adapter_create_ext() allocated memory for adapter, we should free it when error happens, otherwise it will lead to memory leak. Fixes: 7901eac3409a ("eventdev: add crypto adapter implementation") Cc: stable@dpdk.org Signed-off-by: Yunjian Wang --- lib/librte_eventdev/rte_event_crypto_adapter.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/librte_eventdev/rte_event_crypto_adapter.c b/lib/librte_eventdev/rte_event_crypto_adapter.c index 8f2593316..b04312128 100644 --- a/lib/librte_eventdev/rte_event_crypto_adapter.c +++ b/lib/librte_eventdev/rte_event_crypto_adapter.c @@ -241,6 +241,7 @@ rte_event_crypto_adapter_create_ext(uint8_t id, uint8_t dev_id, if (ret < 0) { RTE_EDEV_LOG_ERR("Failed to get info for eventdev %d: %s!", dev_id, dev_info.driver_name); + rte_free(adapter); return ret; } -- 2.23.0