Skip to content

Commit 4c48e54

Browse files
cdleonardlinusw
authored andcommitted
pinctrl: imx: scu: 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: b96eea7 ("pinctrl: fsl: add scu based pinctrl support") Signed-off-by: Leonard Crestez <[email protected]> Link: https://lore.kernel.org/r/bd7ad5fd755739a6d8d5f4f65e03b3ca4f457bd2.1582216144.git.leonard.crestez@nxp.com Signed-off-by: Linus Walleij <[email protected]>
1 parent dc7a06b commit 4c48e54

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/pinctrl/freescale/pinctrl-scu.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ struct imx_sc_msg_req_pad_set {
2323
struct imx_sc_rpc_msg hdr;
2424
u32 val;
2525
u16 pad;
26-
} __packed;
26+
} __packed __aligned(4);
2727

2828
struct imx_sc_msg_req_pad_get {
2929
struct imx_sc_rpc_msg hdr;
3030
u16 pad;
31-
} __packed;
31+
} __packed __aligned(4);
3232

3333
struct imx_sc_msg_resp_pad_get {
3434
struct imx_sc_rpc_msg hdr;

0 commit comments

Comments
 (0)