File tree Expand file tree Collapse file tree 2 files changed +16
-4
lines changed
Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -452,11 +452,14 @@ static int asrc_dai_find(struct comp_dev *dev, struct comp_data *cd)
452452 /* In push mode check if sink component is DAI */
453453 do {
454454 sinkb = comp_dev_get_first_data_consumer (dev );
455+ if (!sinkb ) {
456+ comp_err (asrc_dev , "At end: NULL buffer, no DAI found." );
457+ return - EINVAL ;
458+ }
455459
456460 dev = comp_buffer_get_sink_component (sinkb );
457-
458461 if (!dev ) {
459- comp_err (asrc_dev , "At end, no DAI found." );
462+ comp_err (asrc_dev , "At end: NULL device , no DAI found." );
460463 return - EINVAL ;
461464 }
462465
@@ -470,11 +473,14 @@ static int asrc_dai_find(struct comp_dev *dev, struct comp_data *cd)
470473 /* In pull mode check if source component is DAI */
471474 do {
472475 sourceb = comp_dev_get_first_data_producer (dev );
476+ if (!sourceb ) {
477+ comp_err (asrc_dev , "At beginning: NULL buffer, no DAI found." );
478+ return - EINVAL ;
479+ }
473480
474481 dev = comp_buffer_get_source_component (sourceb );
475-
476482 if (!dev ) {
477- comp_err (asrc_dev , "At beginning, no DAI found." );
483+ comp_err (asrc_dev , "At beginning: NULL device , no DAI found." );
478484 return - EINVAL ;
479485 }
480486
Original file line number Diff line number Diff line change @@ -344,8 +344,14 @@ static int selector_trigger(struct comp_dev *dev, int cmd)
344344 comp_dbg (dev , "selector_trigger()" );
345345
346346 sourceb = comp_dev_get_first_data_producer (dev );
347+ if (!sourceb ) {
348+ comp_err (dev , "source disconnected" );
349+ return - ENODEV ;
350+ }
347351
348352 ret = comp_set_state (dev , cmd );
353+ if (ret == COMP_STATUS_STATE_ALREADY_SET )
354+ ret = 0 ;
349355
350356 /* TODO: remove in the future after adding support for case when
351357 * kpb_init_draining() and kpb_draining_task() are interrupted by
You can’t perform that action at this time.
0 commit comments