ASoC: topology: Properly access value coming from topology file

When accessing values coming from topology, le32_to_cpu should be used.
One of recent commits missed that.

Fixes: 86e2d14b6d ("ASoC: topology: Add header payload_size verification")
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://lore.kernel.org/r/20230127231111.937721-2-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Amadeusz Sławiński 2023-01-28 00:11:01 +01:00 committed by Mark Brown
parent ffe4c0f0bf
commit c5d184c92d
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0

View File

@ -2404,7 +2404,7 @@ static int soc_valid_header(struct soc_tplg *tplg,
return -EINVAL;
}
if (soc_tplg_get_hdr_offset(tplg) + hdr->payload_size >= tplg->fw->size) {
if (soc_tplg_get_hdr_offset(tplg) + le32_to_cpu(hdr->payload_size) >= tplg->fw->size) {
dev_err(tplg->dev,
"ASoC: invalid header of type %d at offset %ld payload_size %d\n",
le32_to_cpu(hdr->type), soc_tplg_get_hdr_offset(tplg),