From patchwork Fri Jun 10 08:14:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hanumanth Pothula X-Patchwork-Id: 112647 X-Patchwork-Delegate: jerinj@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 13166A0553; Fri, 10 Jun 2022 10:14:52 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 043DD406B4; Fri, 10 Jun 2022 10:14:52 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id D214B40689 for ; Fri, 10 Jun 2022 10:14:49 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 25A7wsFO003100 for ; Fri, 10 Jun 2022 01:14:49 -0700 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=pfpt0220; bh=awvR6dzXUP/pHqfimIqPi9MlPEJtjdW+A8kIHHJGSgQ=; b=jKmNQNhLP6q3I/jZ1qJcMZCWcEnNmB6qVWC9y7xv9PSjM+7t1ivs2eq4LN8NBIXS1tS4 1oAAv8pL+FvPRYam6imL2PhC1Yc8Q/2owHmqsNt0jOyTr8GDvJiIvfvZzacC8JFGc8uc k18H8RrD8wf2DHSL8YIlB7gJCdUxzB9Fte5O1eXRy/LKo94Rk60N/J1KqDiJ0JCSv6f1 8JDLBAmixUR5n5fZL1/x5O3hcmpeOnf7qZctbcd+zUK5a6GpZYMApnw+9M4CkQy1BklE qNq0BRFNMcfhAWix8l0wdZCFjzcuCZX/LZpJ9cvVmEPo7PaGwHLsHmWu7fyrIxJ32e0Y ug== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3gkfaxckd0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Fri, 10 Jun 2022 01:14:49 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Fri, 10 Jun 2022 01:14:47 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 10 Jun 2022 01:14:46 -0700 Received: from localhost.localdomain (unknown [10.28.48.102]) by maili.marvell.com (Postfix) with ESMTP id ACD3E3F7050; Fri, 10 Jun 2022 01:14:44 -0700 (PDT) From: Hanumanth Pothula To: Nithin Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Satha Rao CC: , , Subject: [PATCH] common/cnxk: return on fail to init ROC Model Date: Fri, 10 Jun 2022 13:44:14 +0530 Message-ID: <20220610081415.3855297-1-hpothula@marvell.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Proofpoint-GUID: 1Llg7InpFYds8OLQrVAyAh4eBfdiD932 X-Proofpoint-ORIG-GUID: 1Llg7InpFYds8OLQrVAyAh4eBfdiD932 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.874,Hydra:6.0.517,FMLib:17.11.64.514 definitions=2022-06-10_02,2022-06-09_02,2022-02-23_01 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 Return with error on fail to initialize RoC Model. Signed-off-by: Hanumanth Pothula --- drivers/common/cnxk/roc_platform.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/common/cnxk/roc_platform.c b/drivers/common/cnxk/roc_platform.c index ebb6225f4d..443aa8d396 100644 --- a/drivers/common/cnxk/roc_platform.c +++ b/drivers/common/cnxk/roc_platform.c @@ -37,7 +37,12 @@ roc_plt_init(void) plt_err("Failed to reserve mem for roc_model"); return -ENOMEM; } - roc_model_init(mz->addr); + if (roc_model_init(mz->addr)) { + plt_err("Failed to init roc_model"); + + rte_memzone_free(mz); + return -EINVAL; + } } } else { if (mz == NULL) {