Re: [PATCH v2 2/2] ASoC: fsl: imx-card: initialize playback_only and capture_only

From: Mark Brown

Date: Tue Mar 17 2026 - 09:56:10 EST


On Tue, Mar 17, 2026 at 11:39:52AM +0800, Shengjiu Wang wrote:
> Fix uninitialized variable playback_only and capture_only because
> graph_util_parse_link_direction() may not write them.

> @@ -544,7 +544,7 @@ static int imx_card_parse_of(struct imx_card_data *data)
> struct snd_soc_dai_link *link;
> struct dai_link_data *link_data;
> struct of_phandle_args args;
> - bool playback_only, capture_only;
> + bool playback_only = false, capture_only = false;

Don't we need to initalise these once per link rather than once for the
whole function, otherwise if they are initialised one time then any
subsequent links will inherit the new value?

Attachment: signature.asc
Description: PGP signature