]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: Intel: Skylake: Correct the handling of fmt_config flexible array
authorPeter Ujfalusi <peter.ujfalusi@linux.intel.com>
Thu, 30 Jun 2022 06:56:38 +0000 (09:56 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 21 Jul 2022 19:24:19 +0000 (21:24 +0200)
commit85746bc568347108a280d0b111500feb6c891fd2
tree83ab584f8bb1b623912f036ecf4b5b2c399bee5e
parent4290058846dadbb7f3cb8abeed0598bf25a5c917
ASoC: Intel: Skylake: Correct the handling of fmt_config flexible array

[ Upstream commit ec91264ed14b4cb8ae30eb2a8e96c8392154fd50 ]

The struct nhlt_format's fmt_config is a flexible array, it must not be
used as normal array.
When moving to the next nhlt_fmt_cfg we need to take into account the data
behind the ->config.caps (indicated by ->config.size).

The logic of the code also changed: it is no longer saves the _last_
fmt_cfg for all found rates.

Fixes: 79f91cd9defc6 ("ASoC: Intel: Skylake: Parse nhlt and register clock device")
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20220630065638.11183-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/soc/intel/skylake/skl-nhlt.c