]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
ASoC: topology: Fix endianness issue
authorAmadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Wed, 15 Apr 2020 16:24:35 +0000 (12:24 -0400)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Mon, 25 May 2020 08:42:29 +0000 (10:42 +0200)
BugLink: https://bugs.launchpad.net/bugs/1878040
[ Upstream commit 26d87881590fd55ccdd8f829498d7b3033f81990 ]

As done in already existing cases, we should use le32_to_cpu macro while
accessing hdr->magic. Found with sparse.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://lore.kernel.org/r/20200415162435.31859-2-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
sound/soc/soc-topology.c

index 2d4a5a3058c4116db9469ceb8d3a9f6c4068b095..65c91abb9462f365f748f2dd60f5179e88ac742d 100644 (file)
@@ -2559,7 +2559,7 @@ static int soc_valid_header(struct soc_tplg *tplg,
        }
 
        /* big endian firmware objects not supported atm */
-       if (hdr->magic == SOC_TPLG_MAGIC_BIG_ENDIAN) {
+       if (le32_to_cpu(hdr->magic) == SOC_TPLG_MAGIC_BIG_ENDIAN) {
                dev_err(tplg->dev,
                        "ASoC: pass %d big endian not supported header got %x at offset 0x%lx size 0x%zx.\n",
                        tplg->pass, hdr->magic,