[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20170525052929.GE26091@us.ibm.com>
Date: Wed, 24 May 2017 22:29:29 -0700
From: Sukadev Bhattiprolu <sukadev@...ux.vnet.ibm.com>
To: Tyrel Datwyler <tyreld@...ux.vnet.ibm.com>
Cc: Michael Ellerman <mpe@...erman.id.au>, stewart@...ux.vnet.ibm.com,
linuxppc-dev@...abs.org, linux-kernel@...r.kernel.org,
apopple@....ibm.com, oohall@...il.com, michael.neuling@....ibm.com
Subject: Re: [PATCH v4 04/11] VAS: Define vas_init() and vas_exit()
Tyrel Datwyler [tyreld@...ux.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
Powered by blists - more mailing lists