lkml.org 
[lkml]   [2020]   [Apr]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.5 18/30] clk: imx: Align imx sc clock parent msg structs to 4
    Date
    From: Leonard Crestez <leonard.crestez@nxp.com>

    commit 8400ab8896324641243b57fc49b448023c07409a upstream.

    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: 666aed2d13ee ("clk: imx: scu: add set parent support")
    Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
    Link: https://lkml.kernel.org/r/aad021e432b3062c142973d09b766656eec18fde.1582216144.git.leonard.crestez@nxp.com
    Signed-off-by: Stephen Boyd <sboyd@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    ---
    drivers/clk/imx/clk-scu.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    --- a/drivers/clk/imx/clk-scu.c
    +++ b/drivers/clk/imx/clk-scu.c
    @@ -84,7 +84,7 @@ struct imx_sc_msg_get_clock_parent {
    struct req_get_clock_parent {
    __le16 resource;
    u8 clk;
    - } __packed req;
    + } __packed __aligned(4) req;
    struct resp_get_clock_parent {
    u8 parent;
    } resp;

    \
     
     \ /
      Last update: 2020-04-01 18:57    [W:3.738 / U:0.356 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site