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 EF36BA04F0; Thu, 19 Dec 2019 11:44:41 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 175741BDFD; Thu, 19 Dec 2019 11:44:41 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 82D261252 for ; Thu, 19 Dec 2019 11:44:39 +0100 (CET) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id xBJAicPB018149 for ; Thu, 19 Dec 2019 02:44:38 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=pfpt0818; bh=7yM9EGzxMctb4V6Z3XGEdhGpNrDnP0Jm/bIGTQNbkuU=; b=yVjAQ0s8kypb4YcZ+5WdMtj80zIqJYmL4kdhz+/rKOAvtz/DMU7GIQ7HbJ3czzxxzsTs CRfwZWLjO4DDMg1HY0+hxWbPpXZuCTVw4Xeswruyrq+GU9cprDqxqLkQ/x7Y+6rRhf62 nOBhwHRHoJbmGoS376dymssIQCHoPqrnsWgJwvnQocKjdj8cl8/lTqm5mR7Vc0g+EKJ+ nLWHjHF4JvfvLg2U9q9uVW3Rg8MLbDq/ShM8abytwiafcE66w4aQ3P3Lc1hkXnjO7hTa EZAXqdxT9ZMrQ89rvR9aH3eiy+KFZB8XNwBh0JexbxUxZz6/eWfB8sxLbnFOG5vP38tk EA== Received: from sc-exch03.marvell.com ([199.233.58.183]) by mx0a-0016f401.pphosted.com with ESMTP id 2wxneb2jyw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Thu, 19 Dec 2019 02:44:38 -0800 Received: from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 19 Dec 2019 02:44:36 -0800 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 19 Dec 2019 02:44:36 -0800 Received: from kk-box-0.marvell.com (unknown [10.95.130.75]) by maili.marvell.com (Postfix) with ESMTP id 983363F7040; Thu, 19 Dec 2019 02:44:35 -0800 (PST) From: To: , Harman Kalra CC: Krzysztof Kanas , Date: Thu, 19 Dec 2019 11:44:34 +0100 Message-ID: <20191219104434.32578-1-kkanas@marvell.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,18.0.572 definitions=2019-12-19_01:2019-12-17,2019-12-19 signatures=0 Subject: [dpdk-dev] [PATCH] mempool/octeontx: fix error handling in initialization 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" From: Krzysztof Kanas When octeontx_get_fpavf fails fpa pointer is used to get pool_stack_base, which is then freed. Coverity issue: 351263 Fixes: 9bc692f83baa ("mempool/octeontx: add application domain validation") Cc: pbhagavatula@marvell.com Signed-off-by: Krzysztof Kanas --- drivers/mempool/octeontx/octeontx_fpavf.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/mempool/octeontx/octeontx_fpavf.c b/drivers/mempool/octeontx/octeontx_fpavf.c index c97267db3cc3..63f8fb3b500a 100644 --- a/drivers/mempool/octeontx/octeontx_fpavf.c +++ b/drivers/mempool/octeontx/octeontx_fpavf.c @@ -305,10 +305,8 @@ octeontx_fpapf_pool_destroy(unsigned int gpool_index) int ret = -1; fpa = octeontx_get_fpavf(gpool_index); - if (fpa == NULL) { - ret = -EINVAL; - goto err; - } + if (fpa == NULL) + return -EINVAL; hdr.coproc = FPA_COPROC; hdr.msg = FPA_CONFIGSET; -- 2.21.0