[alsa-devel] [PATCH] ASoC: Add a sanity check before using dai driver name
Mark Brown
broonie at kernel.org
Wed Aug 23 13:06:28 CEST 2017
On Wed, Aug 23, 2017 at 07:42:55AM +0800, jeffy wrote:
> i think the original check is allowing NULL dlc dai_name to be a match...
> so we basically did:
> reject when dlc dai_name is valid, but not match the dai name
So it is, but this still looks like the wrong thing - it'll match on an
empty DAI name over an explicit match on the driver name which seems
like it's the wrong way round.
>
> and my patch is:
> accept when dlc dai_name is invalid
> accept when match dai name
> accept when match dai driver name(only when it is valid)
>
> so it's a "if (a && b) reject" to "if (!a || !b) accept" case..
>
> >
> > > + if (dai->driver->name &&
> > > + !strcmp(dai->driver->name, dlc->dai_name))
> >
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20170823/ef560f35/attachment.sig>
More information about the Alsa-devel
mailing list