diff --git a/app/boards/intel_adsp_ace20_lnl.conf b/app/boards/intel_adsp_ace20_lnl.conf index 2d45466913a4..fa9acb84d377 100644 --- a/app/boards/intel_adsp_ace20_lnl.conf +++ b/app/boards/intel_adsp_ace20_lnl.conf @@ -33,6 +33,7 @@ CONFIG_DMA=y CONFIG_DMA_INTEL_ADSP_GPDMA=n CONFIG_INTEL_MODULES=y CONFIG_LIBRARY_MANAGER=y +CONFIG_LIBRARY_AUTH_SUPPORT=y CONFIG_INTEL_ADSP_TIMER=y CONFIG_MM_DRV_INTEL_ADSP_TLB_REMAP_UNUSED_RAM=y CONFIG_AMS=y diff --git a/src/library_manager/lib_manager.c b/src/library_manager/lib_manager.c index 133e2785330b..75b85a05b375 100644 --- a/src/library_manager/lib_manager.c +++ b/src/library_manager/lib_manager.c @@ -97,7 +97,7 @@ static int lib_manager_auth_proc(const void *buffer_data, if (ret != 0) { tr_err(&lib_manager_tr, "lib_manager_auth_proc() failed with error: %d", ret); - return -EACCES; + return -ENOTSUP; } /* The auth_api_busy() will timeouts internally in case of failure */ @@ -108,7 +108,7 @@ static int lib_manager_auth_proc(const void *buffer_data, if (ret != AUTH_IMAGE_TRUSTED) { tr_err(&lib_manager_tr, "lib_manager_auth_proc() Untrasted library!"); - return -ENOTSUP; + return -EACCES; } if (phase == AUTH_PHASE_LAST) @@ -653,8 +653,10 @@ static int lib_manager_store_library(struct lib_manager_dma_ext *dma_ext, /* AUTH_PHASE_FIRST - checks library manifest only. */ ret = lib_manager_auth_proc((__sparse_force void *)man_buffer, MAN_MAX_SIZE_V1_8, AUTH_PHASE_FIRST); - if (ret < 0) + if (ret < 0) { + rfree((__sparse_force void *)library_base_address); return ret; + } #endif /* CONFIG_LIBRARY_AUTH_SUPPORT */ /* Copy data from temp_mft_buf to destination memory (pointed by library_base_address) */ @@ -673,8 +675,10 @@ static int lib_manager_store_library(struct lib_manager_dma_ext *dma_ext, /* AUTH_PHASE_LAST - do final library authentication checks */ ret = lib_manager_auth_proc((__sparse_force void *)library_base_address, preload_size - MAN_MAX_SIZE_V1_8, AUTH_PHASE_LAST); - if (ret < 0) + if (ret < 0) { + rfree((__sparse_force void *)library_base_address); return ret; + } #endif /* CONFIG_LIBRARY_AUTH_SUPPORT */ /* Now update sof context with new library */