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 b79dd050fe11..b4bc8889bb36 100644 --- a/src/library_manager/lib_manager.c +++ b/src/library_manager/lib_manager.c @@ -94,7 +94,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 */ @@ -105,7 +105,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) @@ -650,8 +650,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(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) */ @@ -670,8 +672,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((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 */