Re: [PATCH] ASoC: cs35l56: Allow factory calibration through ALSA controls
From: Mark Brown
Date: Tue Mar 24 2026 - 10:43:55 EST
On Tue, Mar 24, 2026 at 02:24:21PM +0000, Richard Fitzgerald wrote:
> On 24/03/2026 2:02 pm, Mark Brown wrote:
> > On Tue, Mar 24, 2026 at 11:03:02AM +0000, Richard Fitzgerald wrote:
> > > + if (!in_range(ucontrol->value.integer.value[0], 5, 35))
> > > + return -EINVAL;
> > The values range from 5..35...
>
> The second argument to in_range() isn't a max.
> But if I'm sending a new version to make them volatile I can also change
> it to not use the in_range() macro.
Ah, indeed - that's a bit of a footgun! Still, there's also the 0..4
range that's advertised to userspace but not actually valid.
Attachment:
signature.asc
Description: PGP signature