public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
From: sandeep_n@ti•com (Sandeep Nair)
To: linux-arm-kernel@lists•infradead.org
Subject: [PATCH v3 2/3] net: Add Keystone NetCP ethernet driver
Date: Tue, 16 Sep 2014 09:44:59 -0400	[thread overview]
Message-ID: <54183EDB.20801@ti.com> (raw)
In-Reply-To: <20140915.123755.1868053059646672094.davem@davemloft.net>

On 9/15/2014 12:37 PM, David Miller wrote:
> From: Santosh Shilimkar <santosh.shilimkar@ti•com>
> Date: Sat, 13 Sep 2014 16:07:18 -0400
>
>> +	/* Find this module in the sub-tree for this device */
>> +	devices = of_get_child_by_name(node, "netcp-devices");
>> +	if (!devices) {
>> +		dev_err(dev, "could not find netcp-devices node\n");
>> +		return NETCP_MOD_PROBE_SKIPPED;
>> +	}
>> +
>> +	for_each_available_child_of_node(devices, child) {
>> +		const char *name = netcp_node_name(child);
>> +
>> +		if (!strcasecmp(module->name, name))
>> +			break;
>> +	}
>> +
>> +	/* If module not used for this device, skip it */
>> +	if (child == NULL) {
>> +		dev_warn(dev, "module(%s) not used for device\n", module->name);
>> +		return NETCP_MOD_PROBE_SKIPPED;
>> +	}
>
> of_get_child_by_name() takes a reference to an OF node, you must release
> it in the error path.
>
Will fix this.
>> +	inst_modpriv = devm_kzalloc(dev, sizeof(*inst_modpriv), GFP_KERNEL);
>> +	if (!inst_modpriv) {
>> +		dev_err(dev, "Failed to allocate instance for %s\n",
>> +			module->name);
>> +		return -ENOMEM;
>> +	}
>
> Likewise, but here you have to release both "devices" and "child".
>
> You're going to have to fix this OF node refcount problem for this
> entire probe routine.
>
Will do.

Thanks for the review David!

Regards
Sandeep

  reply	other threads:[~2014-09-16 13:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-13 20:07 [PATCH v3 0/3] net: Add Keystone NetCP ethernet driver support Santosh Shilimkar
2014-09-13 20:07 ` [PATCH v3 1/3] Documentation: dt: net: Add binding doc for Keystone NetCP ethernet driver Santosh Shilimkar
2014-09-13 20:07 ` [PATCH v3 3/3] MAINTAINER: net: Add TI NETCP Ethernet driver entry Santosh Shilimkar
     [not found] ` <1410638839-14792-3-git-send-email-santosh.shilimkar@ti.com>
2014-09-15 16:37   ` [PATCH v3 2/3] net: Add Keystone NetCP ethernet driver David Miller
2014-09-16 13:44     ` Sandeep Nair [this message]
     [not found]       ` <542320B3.9020902@ti.com>
2014-09-24 20:43         ` David Miller
2014-09-25 13:43           ` Santosh Shilimkar

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=54183EDB.20801@ti.com \
    --to=sandeep_n@ti$(echo .)com \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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