public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Péter Ujfalusi" <peter.ujfalusi@linux.intel.com>
To: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
	pierre-louis.bossart@linux.intel.com
Cc: lgirdwood@gmail.com, yung-chuan.liao@linux.intel.com,
	ranjani.sridharan@linux.intel.com, kai.vehmanen@linux.intel.com,
	daniel.baluta@nxp.com, broonie@kernel.org, perex@perex.cz,
	tiwai@suse.com, sound-open-firmware@alsa-project.org,
	alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org,
	Abaci Robot <abaci@linux.alibaba.com>
Subject: Re: [PATCH] ASoC: SOF: topology: Fix missing error code in sof_route_load()
Date: Fri, 12 May 2023 13:12:28 +0300	[thread overview]
Message-ID: <947a2a5d-5a63-6437-bfc3-a5c4841152c2@linux.intel.com> (raw)
In-Reply-To: <20230512025410.52832-1-jiapeng.chong@linux.alibaba.com>



On 12/05/2023 05:54, Jiapeng Chong wrote:
> The error code is missing in this code scenario, add the error code
> '-EINVAL' to the return value 'err'.
>
> sound/soc/sof/topology.c:2060 sof_route_load() warn: missing error
code 'ret'.
>
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Robots don't necessarily understand code...
The cases which this is aiming to fix are the cases when we ignore
things, not failing.

Would it be possible to check the code and understand it before sending
a patch?

Nack.

> Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4935
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
> ---
>  sound/soc/sof/topology.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/sound/soc/sof/topology.c b/sound/soc/sof/topology.c
> index d3d536b0a8f5..3ca3a72f1805 100644
> --- a/sound/soc/sof/topology.c
> +++ b/sound/soc/sof/topology.c
> @@ -2045,7 +2045,6 @@ static int sof_route_load(struct
snd_soc_component *scomp, int index,
>  	if (!source_swidget) {
>  		dev_err(scomp->dev, "error: source %s not found\n",
>  			route->source);
> -		ret = -EINVAL;
>  		goto err;
>  	}
>
> @@ -2064,7 +2063,6 @@ static int sof_route_load(struct
snd_soc_component *scomp, int index,
>  	if (!sink_swidget) {
>  		dev_err(scomp->dev, "error: sink %s not found\n",
>  			route->sink);
> -		ret = -EINVAL;
>  		goto err;
>  	}
>
> @@ -2087,6 +2085,8 @@ static int sof_route_load(struct
snd_soc_component *scomp, int index,
>  	return 0;
>  err:
>  	kfree(sroute);
> +	ret = -EINVAL;
> +
>  	return ret;
>  }
>
-- 
Péter

      reply	other threads:[~2023-05-12 10:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-12  2:54 [PATCH] ASoC: SOF: topology: Fix missing error code in sof_route_load() Jiapeng Chong
2023-05-12 10:12 ` Péter Ujfalusi [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=947a2a5d-5a63-6437-bfc3-a5c4841152c2@linux.intel.com \
    --to=peter.ujfalusi@linux.intel.com \
    --cc=abaci@linux.alibaba.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=daniel.baluta@nxp.com \
    --cc=jiapeng.chong@linux.alibaba.com \
    --cc=kai.vehmanen@linux.intel.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=ranjani.sridharan@linux.intel.com \
    --cc=sound-open-firmware@alsa-project.org \
    --cc=tiwai@suse.com \
    --cc=yung-chuan.liao@linux.intel.com \
    /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