linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
To: Tyrel Datwyler <tyreld@linux.vnet.ibm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>,
	stewart@linux.vnet.ibm.com, linuxppc-dev@ozlabs.org,
	linux-kernel@vger.kernel.org, apopple@au1.ibm.com,
	oohall@gmail.com, michael.neuling@au1.ibm.com
Subject: Re: [PATCH v4 04/11] VAS: Define vas_init() and vas_exit()
Date: Wed, 24 May 2017 22:29:29 -0700	[thread overview]
Message-ID: <20170525052929.GE26091@us.ibm.com> (raw)
In-Reply-To: <ec960605-e705-b400-cdc8-def7233d3870@linux.vnet.ibm.com>

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

  reply	other threads:[~2017-05-25  5:29 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-31  5:13 [PATCH v4 00/11] Enable VAS Sukadev Bhattiprolu
2017-03-31  5:13 ` [PATCH v4 01/11] Add Power9 PVR Sukadev Bhattiprolu
2017-03-31  5:13 ` [PATCH v4 02/11] VAS: Define macros, register fields and structures Sukadev Bhattiprolu
2017-04-04 17:17   ` Sukadev Bhattiprolu
2017-03-31  5:13 ` [PATCH v4 03/11] Move GET_FIELD/SET_FIELD to vas.h Sukadev Bhattiprolu
2017-03-31  5:13 ` [PATCH v4 04/11] VAS: Define vas_init() and vas_exit() Sukadev Bhattiprolu
2017-04-02 20:23   ` kbuild test robot
2017-04-04 17:20   ` Sukadev Bhattiprolu
2017-04-24  6:18   ` Benjamin Herrenschmidt
2017-04-24  6:25   ` Benjamin Herrenschmidt
2017-04-24 20:32   ` Tyrel Datwyler
2017-05-25  5:29     ` Sukadev Bhattiprolu [this message]
2017-03-31  5:13 ` [PATCH v4 05/11] VAS: Define helpers for access MMIO regions Sukadev Bhattiprolu
2017-04-24  6:28   ` Benjamin Herrenschmidt
2017-04-24 17:25     ` Sukadev Bhattiprolu
2017-04-24 23:19       ` Benjamin Herrenschmidt
2017-03-31  5:13 ` [PATCH v4 06/11] VAS: Define helpers to init window context Sukadev Bhattiprolu
2017-03-31  5:13 ` [PATCH v4 07/11] VAS: Define helpers to alloc/free windows Sukadev Bhattiprolu
2017-03-31  5:13 ` [PATCH v4 08/11] VAS: Define vas_rx_win_open() interface Sukadev Bhattiprolu
2017-03-31  5:13 ` [PATCH v4 09/11] VAS: Define vas_win_close() interface Sukadev Bhattiprolu
2017-03-31  5:13 ` [PATCH v4 10/11] VAS: Define vas_tx_win_open() Sukadev Bhattiprolu
2017-03-31  5:13 ` [PATCH v4 11/11] VAS: Define copy/paste interfaces Sukadev Bhattiprolu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170525052929.GE26091@us.ibm.com \
    --to=sukadev@linux.vnet.ibm.com \
    --cc=apopple@au1.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=michael.neuling@au1.ibm.com \
    --cc=mpe@ellerman.id.au \
    --cc=oohall@gmail.com \
    --cc=stewart@linux.vnet.ibm.com \
    --cc=tyreld@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).