[alsa-devel] [PATCH] ASoC: Add a sanity check before using dai driver name

Mark Brown broonie at kernel.org
Tue Aug 22 18:17:56 CEST 2017


On Tue, Aug 22, 2017 at 10:45:12PM +0800, Jeffy Chen wrote:

> -			return dai;
> +			if (!dlc->dai_name)
> +				return dai;
> +			if (!strcmp(dai->name, dlc->dai_name))
> +				return dai;

You want (dlc->dai_name && !strcmp(dai->name, dlc->dai_name)) for this
to be equivalent don't you?

> +			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/20170822/9b176174/attachment.sig>


More information about the Alsa-devel mailing list