lkml.org 
[lkml]   [2020]   [Jun]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.7 309/376] clk: mediatek: assign the initial value to clk_init_data of mtk_mux
    Date
    From: Weiyi Lu <weiyi.lu@mediatek.com>

    commit 571cfadcc628dd5591444f7289e27445ea732f4c upstream.

    When some new clock supports are introduced, e.g. [1]
    it might lead to an error although it should be NULL because
    clk_init_data is on the stack and it might have random values
    if using without initialization.
    Add the missing initial value to clk_init_data.

    [1] https://android-review.googlesource.com/c/kernel/common/+/1278046

    Fixes: a3ae549917f1 ("clk: mediatek: Add new clkmux register API")
    Signed-off-by: Weiyi Lu <weiyi.lu@mediatek.com>
    Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>
    Cc: <stable@vger.kernel.org>
    Link: https://lore.kernel.org/r/1590560749-29136-1-git-send-email-weiyi.lu@mediatek.com
    Signed-off-by: Stephen Boyd <sboyd@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

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

    --- a/drivers/clk/mediatek/clk-mux.c
    +++ b/drivers/clk/mediatek/clk-mux.c
    @@ -160,7 +160,7 @@ struct clk *mtk_clk_register_mux(const s
    spinlock_t *lock)
    {
    struct mtk_clk_mux *clk_mux;
    - struct clk_init_data init;
    + struct clk_init_data init = {};
    struct clk *clk;

    clk_mux = kzalloc(sizeof(*clk_mux), GFP_KERNEL);

    \
     
     \ /
      Last update: 2020-06-19 17:33    [W:4.137 / U:0.656 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site