lkml.org 
[lkml]   [2019]   [Jun]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH AUTOSEL 5.1 05/95] soc: brcmstb: Fix error path for unsupported CPUs
    Date
    From: Florian Fainelli <f.fainelli@gmail.com>

    [ Upstream commit 490cad5a3ad6ef0bfd3168a5063140b982f3b22a ]

    In case setup_hifcpubiuctrl_regs() returns an error, because of e.g:
    an unsupported CPU type, just catch that error and return instead of
    blindly continuing with the initialization. This fixes a NULL pointer
    de-reference with the code continuing without having a proper array of
    registers to use.

    Fixes: 22f7a9116eba ("soc: brcmstb: Correct CPU_CREDIT_REG offset for Brahma-B53 CPUs")
    Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    drivers/soc/bcm/brcmstb/biuctrl.c | 4 +++-
    1 file changed, 3 insertions(+), 1 deletion(-)

    diff --git a/drivers/soc/bcm/brcmstb/biuctrl.c b/drivers/soc/bcm/brcmstb/biuctrl.c
    index 6d89ebf13b8a..c16273b31b94 100644
    --- a/drivers/soc/bcm/brcmstb/biuctrl.c
    +++ b/drivers/soc/bcm/brcmstb/biuctrl.c
    @@ -246,7 +246,9 @@ static int __init brcmstb_biuctrl_init(void)
    if (!np)
    return 0;

    - setup_hifcpubiuctrl_regs(np);
    + ret = setup_hifcpubiuctrl_regs(np);
    + if (ret)
    + return ret;

    ret = mcp_write_pairing_set();
    if (ret) {
    --
    2.20.1
    \
     
     \ /
      Last update: 2019-06-27 02:55    [W:4.846 / U:0.020 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site