lkml.org 
[lkml]   [2017]   [May]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v4 04/11] VAS: Define vas_init() and vas_exit()
Tyrel Datwyler [tyreld@linux.vnet.ibm.com] wrote:
> > + vinst = &vas_instances[0];
> > + for_each_node_by_name(dn, "vas") {
> > + rc = init_vas_instance(dn, vinst);
> > + if (rc) {
> > + pr_err("Error %d initializing VAS instance %ld\n", rc,
> > + (vinst-&vas_instances[0]));
>
> You need a of_node_put(dn) here. The for_each_node_by_name() loop will get/put the
> references of the device_node for you. However, if you bail out of the loop you are
> responsible for the of_node_put() on the current *dn reference otherwise you will leak a
> reference.

Thanks for the pointing it out. Based on Ben's comments, I have modified this
code and no longer need to break out of the loop.

Sukadev

\
 
 \ /
  Last update: 2017-05-25 07:30    [W:0.356 / U:0.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site