@@ -800,6 +800,9 @@ static int create_ssp_dailinks(struct snd_soc_card *card,
800
800
char * cpu_dai_name = devm_kasprintf (dev , GFP_KERNEL , "SSP%d Pin" , i );
801
801
char * codec_name = devm_kasprintf (dev , GFP_KERNEL , "i2c-%s:0%d" ,
802
802
ssp_info -> acpi_id , j ++ );
803
+ if (!name || !cpu_dai_name || !codec_name )
804
+ return - ENOMEM ;
805
+
803
806
int playback = ssp_info -> dais [0 ].direction [SNDRV_PCM_STREAM_PLAYBACK ];
804
807
int capture = ssp_info -> dais [0 ].direction [SNDRV_PCM_STREAM_CAPTURE ];
805
808
@@ -866,6 +869,9 @@ static int create_hdmi_dailinks(struct snd_soc_card *card,
866
869
for (i = 0 ; i < hdmi_num ; i ++ ) {
867
870
char * name = devm_kasprintf (dev , GFP_KERNEL , "iDisp%d" , i + 1 );
868
871
char * cpu_dai_name = devm_kasprintf (dev , GFP_KERNEL , "iDisp%d Pin" , i + 1 );
872
+ if (!name || !cpu_dai_name )
873
+ return - ENOMEM ;
874
+
869
875
char * codec_name , * codec_dai_name ;
870
876
871
877
if (intel_ctx -> hdmi .idisp_codec ) {
@@ -877,6 +883,9 @@ static int create_hdmi_dailinks(struct snd_soc_card *card,
877
883
codec_dai_name = "snd-soc-dummy-dai" ;
878
884
}
879
885
886
+ if (!codec_dai_name )
887
+ return - ENOMEM ;
888
+
880
889
ret = asoc_sdw_init_simple_dai_link (dev , * dai_links , be_id , name ,
881
890
1 , 0 , // HDMI only supports playback
882
891
cpu_dai_name , platform_component -> name ,
@@ -900,6 +909,9 @@ static int create_bt_dailinks(struct snd_soc_card *card,
900
909
SOF_BT_OFFLOAD_SSP_SHIFT ;
901
910
char * name = devm_kasprintf (dev , GFP_KERNEL , "SSP%d-BT" , port );
902
911
char * cpu_dai_name = devm_kasprintf (dev , GFP_KERNEL , "SSP%d Pin" , port );
912
+ if (!name || !cpu_dai_name )
913
+ return - ENOMEM ;
914
+
903
915
int ret ;
904
916
905
917
ret = asoc_sdw_init_simple_dai_link (dev , * dai_links , be_id , name ,
0 commit comments