]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
ASoC: SOF: fix 32 signed bit overflow
authorCurtis Malainey <cujomalainey@chromium.org>
Fri, 4 Mar 2022 20:57:31 +0000 (14:57 -0600)
committerMark Brown <broonie@kernel.org>
Mon, 7 Mar 2022 13:12:52 +0000 (13:12 +0000)
Shifting in a signed 32bit container past the signed bit is technically
undefined behaviour. Fix by using unsigned types. Found via cppcheck.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20220304205733.62233-9-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
include/sound/sof/header.h
include/uapi/sound/sof/abi.h

index b97a76bcb65558d8d483960077fbf55c75fd3a21..b22e925c70e27a4cc6ac115795e48b6411b1bdf3 100644 (file)
@@ -31,7 +31,7 @@
 
 /* Global Message - Generic */
 #define SOF_GLB_TYPE_SHIFT                     28
-#define SOF_GLB_TYPE_MASK                      (0xfL << SOF_GLB_TYPE_SHIFT)
+#define SOF_GLB_TYPE_MASK                      (0xfUL << SOF_GLB_TYPE_SHIFT)
 #define SOF_GLB_TYPE(x)                                ((x) << SOF_GLB_TYPE_SHIFT)
 
 /* Command Message - Generic */
index f4232d289a22b57dbdba1e948d10b61c1a54ff73..e052653a6e4ccd2dbfa450357f219e97297e0df0 100644 (file)
@@ -27,7 +27,7 @@
 /* SOF ABI version major, minor and patch numbers */
 #define SOF_ABI_MAJOR 3
 #define SOF_ABI_MINOR 19
-#define SOF_ABI_PATCH 0
+#define SOF_ABI_PATCH 1
 
 /* SOF ABI version number. Format within 32bit word is MMmmmppp */
 #define SOF_ABI_MAJOR_SHIFT    24