diff options
author | Florian Fainelli <f.fainelli@gmail.com> | 2019-04-07 17:19:07 -0400 |
---|---|---|
committer | Florian Fainelli <f.fainelli@gmail.com> | 2019-05-20 12:27:50 -0400 |
commit | 490cad5a3ad6ef0bfd3168a5063140b982f3b22a (patch) | |
tree | 8b041f7eba812b51f84bd0a251e934e3c92e5058 | |
parent | a188339ca5a396acc588e5851ed7e19f66b0ebd9 (diff) |
soc: brcmstb: Fix error path for unsupported CPUs
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>
-rw-r--r-- | drivers/soc/bcm/brcmstb/biuctrl.c | 4 |
1 files changed, 3 insertions, 1 deletions
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) | |||
246 | if (!np) | 246 | if (!np) |
247 | return 0; | 247 | return 0; |
248 | 248 | ||
249 | setup_hifcpubiuctrl_regs(np); | 249 | ret = setup_hifcpubiuctrl_regs(np); |
250 | if (ret) | ||
251 | return ret; | ||
250 | 252 | ||
251 | ret = mcp_write_pairing_set(); | 253 | ret = mcp_write_pairing_set(); |
252 | if (ret) { | 254 | if (ret) { |