From: Sreeraj S Kurup <sreekuttan2156239@gmail.com>
To: perex@perex.cz, tiwai@suse.de
Cc: linux-kernel@vger.kernel.org, linux-sound@vger.kernel.org,
Sreeraj S Kurup <sreekuttan2156239@gmail.com>
Subject: [PATCH] ALSA: vmaster: Check follower callback errors
Date: Thu, 26 Nov 2026 06:53:10 +0000 [thread overview]
Message-ID: <20261126065310.3451-1-sreekuttan2156239@gmail.com> (raw)
Check the return values of follower_get_val() and
follower_put_val() in sync_followers().
Stop synchronization and return the error when either
callback fails.
Signed-off-by: Sreeraj S Kurup <sreekuttan2156239@gmail.com>
---
sound/core/vmaster.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/sound/core/vmaster.c b/sound/core/vmaster.c
index f43144ba2797..88b38ee5ba5f 100644
--- a/sound/core/vmaster.c
+++ b/sound/core/vmaster.c
@@ -345,17 +345,27 @@ static int sync_followers(struct link_master *master, int old_val, int new_val)
struct link_follower *follower;
struct snd_ctl_elem_value *uval __free(kfree) =
kmalloc_obj(*uval);
+ int err;
if (!uval)
return -ENOMEM;
list_for_each_entry(follower, &master->followers, list) {
master->val = old_val;
uval->id = follower->follower.id;
- follower_get_val(follower, uval);
+ err = follower_get_val(follower, uval);
+ if (err < 0)
+ goto error;
+
master->val = new_val;
- follower_put_val(follower, uval);
+ err = follower_put_val(follower, uval);
+ if (err < 0)
+ goto error;
}
return 0;
+
+error:
+ master->val = old_val;
+ return err;
}
static int master_put(struct snd_kcontrol *kcontrol,
--
2.55.0
reply other threads:[~2026-11-26 6:54 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20261126065310.3451-1-sreekuttan2156239@gmail.com \
--to=sreekuttan2156239@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=perex@perex.cz \
--cc=tiwai@suse.de \
/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®