mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Richard Fitzgerald <rf@opensource.cirrus.com>
To: Dan Carpenter <dan.carpenter@linaro.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
	Takashi Iwai <tiwai@suse.com>, <linux-sound@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <kernel-janitors@vger.kernel.org>
Subject: Re: [PATCH v2] ASoC: soc-card: soc-card-test: Fix some error handling in probe()
Date: Wed, 10 Apr 2024 15:43:45 +0100	[thread overview]
Message-ID: <c8e9a7a0-6fcf-4bbe-a659-b2360f5980d8@opensource.cirrus.com> (raw)
In-Reply-To: <2db68591-64e2-4f43-a5e1-cb8849f0a296@moroto.mountain>

On 10/4/24 15:22, Dan Carpenter wrote:
> Fix this reversed if statement and call put_device() before returning
> the error code.
> 
> Fixes: ef7784e41db7 ("ASoC: soc-card: Add KUnit test case for snd_soc_card_get_kcontrol")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
> v2: call put_device()
> 
>   sound/soc/soc-card-test.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/sound/soc/soc-card-test.c b/sound/soc/soc-card-test.c
> index 075c52fe82e5..faf9a3d46884 100644
> --- a/sound/soc/soc-card-test.c
> +++ b/sound/soc/soc-card-test.c
> @@ -148,8 +148,10 @@ static int soc_card_test_case_init(struct kunit *test)
>   	priv->card->owner = THIS_MODULE;
>   
>   	ret = snd_soc_register_card(priv->card);
> -	if (!ret)
> +	if (ret) {
> +		put_device(priv->card_dev);
>   		return ret;
> +	}
>   
>   	return 0;
>   }

Thanks.
Reviewed-by: Richard Fitzgerald <rf@opensource.cirrus.com>

I can see that put_device() is also missing earlier in the
function:

	if (!priv->card)
		return -ENOMEM;

I can send a fix for that.

  reply	other threads:[~2024-04-10 14:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-10 14:22 Dan Carpenter
2024-04-10 14:43 ` Richard Fitzgerald [this message]
2024-04-10 15:31   ` Dan Carpenter
2024-04-10 15:37     ` Richard Fitzgerald

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=c8e9a7a0-6fcf-4bbe-a659-b2360f5980d8@opensource.cirrus.com \
    --to=rf@opensource.cirrus.com \
    --cc=broonie@kernel.org \
    --cc=dan.carpenter@linaro.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.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

all inboxes | Powered by JetHome®