diff options
author | Nicholas Mc Guire <hofrat@osadl.org> | 2018-07-12 05:28:22 -0400 |
---|---|---|
committer | Wei Xu <xuwei5@hisilicon.com> | 2018-07-16 12:36:42 -0400 |
commit | 9f30b5ae0585ca5234fe979294b8f897299dec99 (patch) | |
tree | 1845b5e6fd8ba5a0403951ba6603893f6f5b453b /arch/arm/mach-hisi | |
parent | ce397d215ccd07b8ae3f71db689aedb85d56ab40 (diff) |
ARM: hisi: fix error handling and missing of_node_put
of_iomap() can return NULL which seems critical here and thus should be
explicitly flagged so that the cause of system halting can be understood.
As of_find_compatible_node() is returning a device node with refcount
incremented it must be explicitly decremented here.
Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Fixes: commit 7fda91e73155 ("ARM: hisi: enable smp for HiP01")
Signed-off-by: Wei Xu <xuwei5@hisilicon.com>
Diffstat (limited to 'arch/arm/mach-hisi')
-rw-r--r-- | arch/arm/mach-hisi/hotplug.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/arm/mach-hisi/hotplug.c b/arch/arm/mach-hisi/hotplug.c index a129aae72602..3b0d1c695108 100644 --- a/arch/arm/mach-hisi/hotplug.c +++ b/arch/arm/mach-hisi/hotplug.c | |||
@@ -219,10 +219,10 @@ void hip01_set_cpu(int cpu, bool enable) | |||
219 | 219 | ||
220 | if (!ctrl_base) { | 220 | if (!ctrl_base) { |
221 | np = of_find_compatible_node(NULL, NULL, "hisilicon,hip01-sysctrl"); | 221 | np = of_find_compatible_node(NULL, NULL, "hisilicon,hip01-sysctrl"); |
222 | if (np) | 222 | BUG_ON(!np); |
223 | ctrl_base = of_iomap(np, 0); | 223 | ctrl_base = of_iomap(np, 0); |
224 | else | 224 | of_node_put(np); |
225 | BUG(); | 225 | BUG_ON(!ctrl_base); |
226 | } | 226 | } |
227 | 227 | ||
228 | if (enable) { | 228 | if (enable) { |