lkml.org 
[lkml]   [2019]   [Apr]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2 04/15] ARM: hisi: fix a leaked reference by adding missing of_node_put
From
Date
> @@ -285,12 +286,14 @@  static int __init hip04_smp_init(void)
> if (!np_sctl)
> goto err;
> np_fab = of_find_compatible_node(NULL, NULL, "hisilicon,hip04-fabric");
> - if (!np_fab)
> + if (!np_fab) {
> + of_node_put(np_sctl);
> goto err;

I suggest to adjust this source code place in a different way.

if (!np_fab)
+ goto put_sctl_node;


> + }
>
> ret = memblock_reserve(hip04_boot_method[0], hip04_boot_method[1]);
> if (ret)
> - goto err;
> + goto err_put_node;

How do you think about to use the jump label “put_fab_node” instead?


>
> relocation = ioremap(hip04_boot_method[2], hip04_boot_method[3]);


Regards,
Markus

\
 
 \ /
  Last update: 2019-04-05 13:28    [W:0.141 / U:0.508 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site