@@ -38,7 +38,6 @@ static inline int _soc_pcm_ret(struct snd_soc_pcm_runtime *rtd,
3838 switch (ret ) {
3939 case - EPROBE_DEFER :
4040 case - ENOTSUPP :
41- case - EINVAL :
4241 break ;
4342 default :
4443 dev_err (rtd -> dev ,
@@ -1001,7 +1000,13 @@ static int __soc_pcm_prepare(struct snd_soc_pcm_runtime *rtd,
10011000 }
10021001
10031002out :
1004- return soc_pcm_ret (rtd , ret );
1003+ /*
1004+ * Don't use soc_pcm_ret() on .prepare callback to lower error log severity
1005+ *
1006+ * We don't want to log an error since we do not want to give userspace a way to do a
1007+ * denial-of-service attack on the syslog / diskspace.
1008+ */
1009+ return ret ;
10051010}
10061011
10071012/* PCM prepare ops for non-DPCM streams */
@@ -1013,6 +1018,13 @@ static int soc_pcm_prepare(struct snd_pcm_substream *substream)
10131018 snd_soc_dpcm_mutex_lock (rtd );
10141019 ret = __soc_pcm_prepare (rtd , substream );
10151020 snd_soc_dpcm_mutex_unlock (rtd );
1021+
1022+ /*
1023+ * Don't use soc_pcm_ret() on .prepare callback to lower error log severity
1024+ *
1025+ * We don't want to log an error since we do not want to give userspace a way to do a
1026+ * denial-of-service attack on the syslog / diskspace.
1027+ */
10161028 return ret ;
10171029}
10181030
@@ -2554,7 +2566,13 @@ int dpcm_be_dai_prepare(struct snd_soc_pcm_runtime *fe, int stream)
25542566 be -> dpcm [stream ].state = SND_SOC_DPCM_STATE_PREPARE ;
25552567 }
25562568
2557- return soc_pcm_ret (fe , ret );
2569+ /*
2570+ * Don't use soc_pcm_ret() on .prepare callback to lower error log severity
2571+ *
2572+ * We don't want to log an error since we do not want to give userspace a way to do a
2573+ * denial-of-service attack on the syslog / diskspace.
2574+ */
2575+ return ret ;
25582576}
25592577
25602578static int dpcm_fe_dai_prepare (struct snd_pcm_substream * substream )
@@ -2594,7 +2612,13 @@ static int dpcm_fe_dai_prepare(struct snd_pcm_substream *substream)
25942612 dpcm_set_fe_update_state (fe , stream , SND_SOC_DPCM_UPDATE_NO );
25952613 snd_soc_dpcm_mutex_unlock (fe );
25962614
2597- return soc_pcm_ret (fe , ret );
2615+ /*
2616+ * Don't use soc_pcm_ret() on .prepare callback to lower error log severity
2617+ *
2618+ * We don't want to log an error since we do not want to give userspace a way to do a
2619+ * denial-of-service attack on the syslog / diskspace.
2620+ */
2621+ return ret ;
25982622}
25992623
26002624static int dpcm_run_update_shutdown (struct snd_soc_pcm_runtime * fe , int stream )
0 commit comments