mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-06 16:49:22 +00:00
ARM: hisi: fix error handling and missing of_node_put
[ Upstream commit9f30b5ae05
] 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: commit7fda91e731
("ARM: hisi: enable smp for HiP01") Signed-off-by: Wei Xu <xuwei5@hisilicon.com> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
24dbc773dd
commit
e1912dc20c
1 changed files with 4 additions and 4 deletions
|
@ -226,10 +226,10 @@ void hip01_set_cpu(int cpu, bool enable)
|
|||
|
||||
if (!ctrl_base) {
|
||||
np = of_find_compatible_node(NULL, NULL, "hisilicon,hip01-sysctrl");
|
||||
if (np)
|
||||
ctrl_base = of_iomap(np, 0);
|
||||
else
|
||||
BUG();
|
||||
BUG_ON(!np);
|
||||
ctrl_base = of_iomap(np, 0);
|
||||
of_node_put(np);
|
||||
BUG_ON(!ctrl_base);
|
||||
}
|
||||
|
||||
if (enable) {
|
||||
|
|
Loading…
Reference in a new issue