[PATCH] common/cnxk: return on fail to init ROC Model

Hanumanth Pothula hpothula at marvell.com
Fri Jun 10 10:14:14 CEST 2022


Return with error on fail to initialize RoC Model.

Signed-off-by: Hanumanth Pothula <hpothula at marvell.com>
---
 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) {
-- 
2.25.1



More information about the dev mailing list