Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions sound/soc/sof/sof-audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ static int sof_set_up_same_dir_widget_routes(struct snd_sof_dev *sdev,
* to check if the direction_valid is set for one of the widgets as all widgets will have
* the direction set in topology if one is set.
*/
if (sink_widget->spipe->direction_valid &&
if (sink_widget->spipe && sink_widget->spipe->direction_valid &&
!sof_widget_in_same_direction(sink_widget, src_widget->spipe->direction))
return 0;

Expand Down Expand Up @@ -416,7 +416,7 @@ static int sof_setup_pipeline_connections(struct snd_sof_dev *sdev,
* is set.
*/
if (src_widget && sink_widget &&
src_widget->spipe->direction_valid &&
src_widget->spipe && src_widget->spipe->direction_valid &&
sof_widget_in_same_direction(sink_widget, src_widget->spipe->direction))
continue;
}
Expand Down Expand Up @@ -446,7 +446,8 @@ sof_unprepare_widgets_in_path(struct snd_sof_dev *sdev, struct snd_soc_dapm_widg
if (!swidget)
goto sink_unprepare;

if (swidget->spipe->direction_valid && !sof_widget_in_same_direction(swidget, dir))
if (swidget->spipe && swidget->spipe->direction_valid &&
!sof_widget_in_same_direction(swidget, dir))
return;

/* skip widgets in use, those already unprepared or aggregated DAIs */
Expand Down Expand Up @@ -497,7 +498,8 @@ sof_prepare_widgets_in_path(struct snd_sof_dev *sdev, struct snd_soc_dapm_widget
if (!widget_ops)
return 0;

if (swidget->spipe->direction_valid && !sof_widget_in_same_direction(swidget, dir))
if (swidget->spipe && swidget->spipe->direction_valid &&
!sof_widget_in_same_direction(swidget, dir))
return 0;

/* skip widgets already prepared or aggregated DAI widgets*/
Expand Down Expand Up @@ -561,7 +563,8 @@ static int sof_free_widgets_in_path(struct snd_sof_dev *sdev, struct snd_soc_dap
if (!swidget)
goto sink_free;

if (swidget->spipe->direction_valid && !sof_widget_in_same_direction(swidget, dir))
if (swidget->spipe && swidget->spipe->direction_valid &&
!sof_widget_in_same_direction(swidget, dir))
return 0;

/* skip aggregated DAIs */
Expand Down Expand Up @@ -611,7 +614,8 @@ static int sof_set_up_widgets_in_path(struct snd_sof_dev *sdev, struct snd_soc_d
if (swidget) {
int i;

if (swidget->spipe->direction_valid && !sof_widget_in_same_direction(swidget, dir))
if (swidget->spipe && swidget->spipe->direction_valid &&
!sof_widget_in_same_direction(swidget, dir))
return 0;

/* skip aggregated DAIs */
Expand Down
Loading