File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -139,12 +139,19 @@ __cold struct comp_dev *comp_new_ipc4(struct ipc4_module_init_instance *module_i
139139 ipc_config .core = module_init -> extension .r .core_id ;
140140 ipc_config .ipc_config_size = module_init -> extension .r .param_block_size * sizeof (uint32_t );
141141 ipc_config .ipc_extended_init = module_init -> extension .r .extended_init ;
142-
143- dcache_invalidate_region ((__sparse_force void __sparse_cache * )MAILBOX_HOSTBOX_BASE ,
144- MAILBOX_HOSTBOX_SIZE );
145-
142+ if (ipc_config .ipc_config_size > MAILBOX_HOSTBOX_SIZE ) {
143+ tr_err (& ipc_tr , "IPC payload size %u too big for the message window" ,
144+ ipc_config .ipc_config_size );
145+ return NULL ;
146+ }
147+ #ifdef CONFIG_DCACHE_LINE_SIZE
148+ if (!IS_ENABLED (CONFIG_LIBRARY ))
149+ sys_cache_data_invd_range ((__sparse_force void __sparse_cache * )
150+ MAILBOX_HOSTBOX_BASE ,
151+ ALIGN_UP (ipc_config .ipc_config_size ,
152+ CONFIG_DCACHE_LINE_SIZE ));
153+ #endif
146154 data = ipc4_get_comp_new_data ();
147-
148155#if CONFIG_LIBRARY
149156 ipc_config .ipc_config_size -= sizeof (struct sof_uuid );
150157 drv = ipc4_library_get_comp_drv (data + ipc_config .ipc_config_size );
You can’t perform that action at this time.
0 commit comments