Patch "clk: rockchip: Initialize hw to error to avoid undefined behavior" has been added to the 5.8-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    clk: rockchip: Initialize hw to error to avoid undefined behavior

to the 5.8-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     clk-rockchip-initialize-hw-to-error-to-avoid-undefin.patch
and it can be found in the queue-5.8 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 3d6b8f4637334ad28601e3f375c12bdcb56d3d31
Author: Stephen Boyd <sboyd@xxxxxxxxxx>
Date:   Wed Sep 23 17:41:44 2020 -0700

    clk: rockchip: Initialize hw to error to avoid undefined behavior
    
    [ Upstream commit b608f11d49ec671739604cc763248d8e8fadbbeb ]
    
    We can get down to this return value from ERR_CAST() without
    initializing hw. Set it to -ENOMEM so that we always return something
    sane.
    
    Fixes the following smatch warning:
    
    drivers/clk/rockchip/clk-half-divider.c:228 rockchip_clk_register_halfdiv() error: uninitialized symbol 'hw'.
    drivers/clk/rockchip/clk-half-divider.c:228 rockchip_clk_register_halfdiv() warn: passing zero to 'ERR_CAST'
    
    Cc: Elaine Zhang <zhangqing@xxxxxxxxxxxxxx>
    Cc: Heiko Stuebner <heiko@xxxxxxxxx>
    Fixes: 956060a52795 ("clk: rockchip: add support for half divider")
    Reviewed-by: Heiko Stuebner <heiko@xxxxxxxxx>
    Signed-off-by: Stephen Boyd <sboyd@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/clk/rockchip/clk-half-divider.c b/drivers/clk/rockchip/clk-half-divider.c
index b333fc28c94b6..37c858d689e0d 100644
--- a/drivers/clk/rockchip/clk-half-divider.c
+++ b/drivers/clk/rockchip/clk-half-divider.c
@@ -166,7 +166,7 @@ struct clk *rockchip_clk_register_halfdiv(const char *name,
 					  unsigned long flags,
 					  spinlock_t *lock)
 {
-	struct clk *clk;
+	struct clk *clk = ERR_PTR(-ENOMEM);
 	struct clk_mux *mux = NULL;
 	struct clk_gate *gate = NULL;
 	struct clk_divider *div = NULL;



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux