Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

firmware: imx: scu-pd: Align imx sc msg structs to 4

The imx SC api strongly assumes that messages are composed out of
4-bytes words but some of our message structs have odd sizeofs.

This produces many oopses with CONFIG_KASAN=y.

Fix by marking with __aligned(4).

Fixes: c800cd7824bd ("firmware: imx: add SCU power domain driver")
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>

authored by

Leonard Crestez and committed by
Shawn Guo
7c1a1c81 1e6a4eba

+1 -1
+1 -1
drivers/firmware/imx/scu-pd.c
··· 61 61 struct imx_sc_rpc_msg hdr; 62 62 u16 resource; 63 63 u8 mode; 64 - } __packed; 64 + } __packed __aligned(4); 65 65 66 66 #define IMX_SCU_PD_NAME_SIZE 20 67 67 struct imx_sc_pm_domain {