aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmadeusz Sławiński <[email protected]>2023-01-28 00:11:01 +0100
committerMark Brown <[email protected]>2023-01-30 16:56:02 +0000
commitc5d184c92df2b631fb81fe2ce6e96bfc5ba720e5 (patch)
tree05e733cccedb7cb856d36ed80f062aa48c4d4150
parentffe4c0f0bfaa571a676a0e946d4a6a0607f94294 (diff)
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: 86e2d14b6d1a ("ASoC: topology: Add header payload_size verification") Reviewed-by: Cezary Rojewski <[email protected]> Reviewed-by: Ranjani Sridharan <[email protected]> Signed-off-by: Amadeusz Sławiński <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
-rw-r--r--sound/soc/soc-topology.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c
index c3be24b2fac5..b9addbab2b3d 100644
--- a/sound/soc/soc-topology.c
+++ b/sound/soc/soc-topology.c
@@ -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),