From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
To: Hans de Goede <hdegoede@redhat.com>
Cc: Mark Brown <broonie@kernel.org>, linux-sound@vger.kernel.org
Subject: Re: [PATCH] ASoC: soc-pcm: don't ignore -EINVAL on soc_pcm_ret()
Date: Fri, 13 Dec 2024 00:25:36 +0000 [thread overview]
Message-ID: <87ed2c8m4f.wl-kuninori.morimoto.gx@renesas.com> (raw)
In-Reply-To: <8ba4dbc0-323e-47cf-9d74-88495f4c40a2@redhat.com>
Hi Hans
Thank you for the feedback
> -EINVAL really should only be used upon invalid parameters coming from
> userspace and in that case we don't want to log an error since we do
> not want to give userspace a way to do a denial-of-service attack
> on the syslog / diskspace.
>
> I'm not convinced that this change is a good idea, but I also
> have no strong objections.
Thanks but hmm...
In reality, -EINVAL is used not only from userspace, and many inside
kernel functions are using it. So don't indicate -EINVAL for all case
is over-kill in real world. But thank you for clarify the situation.
I think indicating it on comment is good idea.
> > @@ -2560,8 +2559,8 @@ static int dpcm_fe_dai_prepare(struct snd_pcm_substream *substream)
> > fe->dai_link->name);
> > dev_dbg(fe->dev, "ASoC: no backend DAIs enabled for %s\n",
> > fe->dai_link->name);
> > - ret = -EINVAL;
> > - goto out;
> > + /* don't use soc_pcm_ret() to lower error log severity */
> > + return -EINVAL;
>
> You cannot just do a return here, you are now missing these 2 lines from
> the "goto out" path:
Oh, yes, indeed.
Thank you for pointing it. Will fix in v2
Thank you for your help !!
Best regards
---
Kuninori Morimoto
prev parent reply other threads:[~2024-12-13 0:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-12 2:23 [PATCH] ASoC: soc-pcm: don't ignore -EINVAL on soc_pcm_ret() Kuninori Morimoto
2024-12-12 9:43 ` Hans de Goede
2024-12-13 0:25 ` Kuninori Morimoto [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ed2c8m4f.wl-kuninori.morimoto.gx@renesas.com \
--to=kuninori.morimoto.gx@renesas.com \
--cc=broonie@kernel.org \
--cc=hdegoede@redhat.com \
--cc=linux-sound@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox