[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <2db68591-64e2-4f43-a5e1-cb8849f0a296@moroto.mountain>
Date: Wed, 10 Apr 2024 17:22:32 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: Richard Fitzgerald <rf@...nsource.cirrus.com>
Cc: Liam Girdwood <lgirdwood@...il.com>, Mark Brown <broonie@...nel.org>,
Jaroslav Kysela <perex@...ex.cz>, Takashi Iwai <tiwai@...e.com>,
linux-sound@...r.kernel.org, linux-kernel@...r.kernel.org,
kernel-janitors@...r.kernel.org
Subject: [PATCH v2] ASoC: soc-card: soc-card-test: Fix some error handling in
probe()
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@...aro.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;
}
--
2.43.0
Powered by blists - more mailing lists