@@ -319,7 +319,7 @@ static int sof_set_up_same_dir_widget_routes(struct snd_sof_dev *sdev,
319319 * to check if the direction_valid is set for one of the widgets as all widgets will have
320320 * the direction set in topology if one is set.
321321 */
322- if (sink_widget -> spipe -> direction_valid &&
322+ if (sink_widget -> spipe && sink_widget -> spipe -> direction_valid &&
323323 !sof_widget_in_same_direction (sink_widget , src_widget -> spipe -> direction ))
324324 return 0 ;
325325
@@ -416,7 +416,7 @@ static int sof_setup_pipeline_connections(struct snd_sof_dev *sdev,
416416 * is set.
417417 */
418418 if (src_widget && sink_widget &&
419- src_widget -> spipe -> direction_valid &&
419+ src_widget -> spipe && src_widget -> spipe -> direction_valid &&
420420 sof_widget_in_same_direction (sink_widget , src_widget -> spipe -> direction ))
421421 continue ;
422422 }
@@ -446,7 +446,8 @@ sof_unprepare_widgets_in_path(struct snd_sof_dev *sdev, struct snd_soc_dapm_widg
446446 if (!swidget )
447447 goto sink_unprepare ;
448448
449- if (swidget -> spipe -> direction_valid && !sof_widget_in_same_direction (swidget , dir ))
449+ if (swidget -> spipe && swidget -> spipe -> direction_valid &&
450+ !sof_widget_in_same_direction (swidget , dir ))
450451 return ;
451452
452453 /* skip widgets in use, those already unprepared or aggregated DAIs */
@@ -497,7 +498,8 @@ sof_prepare_widgets_in_path(struct snd_sof_dev *sdev, struct snd_soc_dapm_widget
497498 if (!widget_ops )
498499 return 0 ;
499500
500- if (swidget -> spipe -> direction_valid && !sof_widget_in_same_direction (swidget , dir ))
501+ if (swidget -> spipe && swidget -> spipe -> direction_valid &&
502+ !sof_widget_in_same_direction (swidget , dir ))
501503 return 0 ;
502504
503505 /* skip widgets already prepared or aggregated DAI widgets*/
@@ -561,7 +563,8 @@ static int sof_free_widgets_in_path(struct snd_sof_dev *sdev, struct snd_soc_dap
561563 if (!swidget )
562564 goto sink_free ;
563565
564- if (swidget -> spipe -> direction_valid && !sof_widget_in_same_direction (swidget , dir ))
566+ if (swidget -> spipe && swidget -> spipe -> direction_valid &&
567+ !sof_widget_in_same_direction (swidget , dir ))
565568 return 0 ;
566569
567570 /* skip aggregated DAIs */
@@ -611,7 +614,8 @@ static int sof_set_up_widgets_in_path(struct snd_sof_dev *sdev, struct snd_soc_d
611614 if (swidget ) {
612615 int i ;
613616
614- if (swidget -> spipe -> direction_valid && !sof_widget_in_same_direction (swidget , dir ))
617+ if (swidget -> spipe && swidget -> spipe -> direction_valid &&
618+ !sof_widget_in_same_direction (swidget , dir ))
615619 return 0 ;
616620
617621 /* skip aggregated DAIs */
0 commit comments