From: Takashi Iwai <tiwai@suse.de>
To: songxiebing <songxiebing@kylinos.cn>
Cc: tiwai@suse.com, perex@perex.cz, linux-sound@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ALSA: mixer: oss: Fix uninitialized index in recsrc ioctls
Date: Wed, 04 Nov 2026 15:34:16 +0100 [thread overview]
Message-ID: <874idwvf6f.wl-tiwai@suse.de> (raw)
In-Reply-To: <20261104075642.1790966-1-songxiebing@kylinos.cn>
On Wed, 04 Nov 2026 08:56:42 +0100,
songxiebing wrote:
>
> From: Bob Song <songxiebing@kylinos.cn>
>
> snd_mixer_oss_get_recsrc2() returns success without setting active_index
> when the current Capture Source does not match any OSS mixer slot.
> snd_mixer_oss_get_recsrc() then uses that uninitialized index for
> "1 << index", and snd_mixer_oss_set_recsrc() does the same while ignoring
> the callback's return value.
>
> Make get_recsrc2() return -ENOENT if no slot matches, only use the
> returned index in set_recsrc() when the lookup succeeds, and initialize
> the index variables as a defensive measure.
>
> Signed-off-by: Bob Song <songxiebing@kylinos.cn>
I guess that the error is rather hypothetical and not triggered by the
current use case?
As it doesn't look like an urgent fix, I applied to for-next branch
now. Thanks.
Takashi
prev parent reply other threads:[~2026-11-04 14:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-04 7:56 songxiebing
2026-11-04 14:34 ` Takashi Iwai [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=874idwvf6f.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=perex@perex.cz \
--cc=songxiebing@kylinos.cn \
--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®