common/cnxk: handle ROC model init failure

Return with error on fail to initialize ROC model.

Fixes: 014a9e222bac ("common/cnxk: add model init and IO handling API")
Cc: stable@dpdk.org

Signed-off-by: Hanumanth Pothula <hpothula@marvell.com>
This commit is contained in:
Hanumanth Pothula 2022-06-10 13:44:14 +05:30 committed by Jerin Jacob
parent bde0d30aed
commit 5f27618bea

View File

@ -37,7 +37,11 @@ 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) {