[vivante] Return when error main tizen
authorYongjoo Ahn <yongjoo1.ahn@samsung.com>
Thu, 12 Jun 2025 06:16:46 +0000 (15:16 +0900)
committerSangjung Woo <again4you@gmail.com>
Thu, 12 Jun 2025 06:41:16 +0000 (15:41 +0900)
- Let the configuration returns when the model initalization is failed

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
src/hal-backend-ml-vivante.cc

index 546eb4e115d6ba722cecef6ebcdcfb11bd9fc176..cfdf51702414097a96812b3093c2de4603fd84ca 100644 (file)
@@ -524,8 +524,11 @@ ml_vivante_configure_instance (void *backend_private, const void *prop_)
       g_critical ("[vivante] JSON loading was selected, but no JSON path was provided via 'json:' custom property.");
       return HAL_ML_ERROR_INVALID_PARAMETER;
     }
-    if (_json_create_neural_network (vivante) != HAL_ML_ERROR_NONE) {
+
+    int status = _json_create_neural_network (vivante);
+    if (status != HAL_ML_ERROR_NONE) {
       g_critical ("[vivante] Failed to create VSI graph.");
+      return status;
     }
   } else {
     if (prop->num_models <= 1) {
@@ -533,8 +536,11 @@ ml_vivante_configure_instance (void *backend_private, const void *prop_)
       return HAL_ML_ERROR_INVALID_PARAMETER;
     }
     vivante->so_path = g_strdup (prop->model_files[1]);
+
+    int status = _so_create_neural_network (vivante);
     if (_so_create_neural_network (vivante) != HAL_ML_ERROR_NONE) {
       g_critical ("[vivante] Failed to create VSI graph.");
+      return status;
     }
   }