File tree Expand file tree Collapse file tree 4 files changed +36
-7
lines changed
Expand file tree Collapse file tree 4 files changed +36
-7
lines changed Original file line number Diff line number Diff line change @@ -167,28 +167,42 @@ static inline void arch_run_task(struct task *task)
167167/**
168168 * \brief Allocates IRQ tasks.
169169 */
170- static inline void arch_allocate_tasks (void )
170+ static inline int arch_allocate_tasks (void )
171171{
172172 /* irq low */
173173 struct irq_task * * low = task_irq_low_get ();
174174 * low = rzalloc (RZONE_RUNTIME , SOF_MEM_CAPS_RAM , sizeof (* * low ));
175+
176+ if (!* low )
177+ return - ENOMEM ;
178+
175179 list_init (& ((* low )-> list ));
176180 spinlock_init (& ((* low )-> lock ));
177181 (* low )-> irq = PLATFORM_IRQ_TASK_LOW ;
178182
179183 /* irq medium */
180184 struct irq_task * * med = task_irq_med_get ();
181185 * med = rzalloc (RZONE_RUNTIME , SOF_MEM_CAPS_RAM , sizeof (* * med ));
186+
187+ if (!* med )
188+ return - ENOMEM ;
189+
182190 list_init (& ((* med )-> list ));
183191 spinlock_init (& ((* med )-> lock ));
184192 (* med )-> irq = PLATFORM_IRQ_TASK_MED ;
185193
186194 /* irq high */
187195 struct irq_task * * high = task_irq_high_get ();
188196 * high = rzalloc (RZONE_RUNTIME , SOF_MEM_CAPS_RAM , sizeof (* * high ));
197+
198+ if (!* high )
199+ return - ENOMEM ;
200+
189201 list_init (& ((* high )-> list ));
190202 spinlock_init (& ((* high )-> lock ));
191203 (* high )-> irq = PLATFORM_IRQ_TASK_HIGH ;
204+
205+ return 0 ;
192206}
193207
194208/**
Original file line number Diff line number Diff line change @@ -345,12 +345,23 @@ static int fir_cmd_get_data(struct comp_dev *dev,
345345 case SOF_CTRL_CMD_BINARY :
346346 trace_eq ("gbi" );
347347
348+ struct sof_eq_fir_config * cfg =
349+ (struct sof_eq_fir_config * )cdata -> data -> data ;
350+
348351 /* Copy back to user space */
349- bs = cd -> config -> size ;
352+ bs = cfg -> size ;
350353 if (bs > SOF_EQ_FIR_MAX_SIZE || bs < 1 )
351354 return - EINVAL ;
352- if (!cd -> config )
355+ if (!cd -> config ) {
356+ cd -> config = rzalloc (RZONE_RUNTIME ,
357+ SOF_MEM_CAPS_RAM ,
358+ bs );
359+
360+ if (!cd -> config )
361+ return - ENOMEM ;
362+
353363 memcpy (cdata -> data -> data , cd -> config , bs );
364+ }
354365 break ;
355366 default :
356367 trace_eq_error ("egt" );
Original file line number Diff line number Diff line change @@ -40,9 +40,9 @@ int do_task_master_core(struct sof *sof);
4040
4141int do_task_slave_core (struct sof * sof );
4242
43- static inline void allocate_tasks (void )
43+ static inline int allocate_tasks (void )
4444{
45- arch_allocate_tasks ();
45+ return arch_allocate_tasks ();
4646}
4747
4848static inline void run_task (struct task * task )
Original file line number Diff line number Diff line change @@ -375,6 +375,10 @@ int scheduler_init(struct sof *sof)
375375
376376 struct schedule_data * * sch = arch_schedule_get ();
377377 * sch = rzalloc (RZONE_RUNTIME , SOF_MEM_CAPS_RAM , sizeof (* * sch ));
378+
379+ if (!* sch )
380+ return - ENOMEM ;
381+
378382 list_init (& ((* sch )-> list ));
379383 spinlock_init (& ((* sch )-> lock ));
380384 (* sch )-> clock = PLATFORM_SCHED_CLOCK ;
@@ -385,9 +389,9 @@ int scheduler_init(struct sof *sof)
385389 interrupt_enable (PLATFORM_SCHEDULE_IRQ );
386390
387391 /* allocate arch tasks */
388- allocate_tasks ();
392+ int tasks_result = allocate_tasks ();
389393
390- return 0 ;
394+ return tasks_result ;
391395}
392396
393397/* Frees scheduler */
You can’t perform that action at this time.
0 commit comments