All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sandeep Nair <sandeep_n@ti.com>
To: David Miller <davem@davemloft.net>, <santosh.shilimkar@ti.com>
Cc: <netdev@vger.kernel.org>, <linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>, <robh+dt@kernel.org>,
	<grant.likely@linaro.org>, <devicetree@vger.kernel.org>,
	<jhs@mojatatu.com>
Subject: Re: [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


WARNING: multiple messages have this Message-ID (diff)
From: Sandeep Nair <sandeep_n@ti.com>
To: David Miller <davem@davemloft.net>, santosh.shilimkar@ti.com
Cc: netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, robh+dt@kernel.org,
	grant.likely@linaro.org, devicetree@vger.kernel.org,
	jhs@mojatatu.com
Subject: Re: [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

WARNING: multiple messages have this Message-ID (diff)
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:45 UTC|newest]

Thread overview: 27+ 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 ` Santosh Shilimkar
2014-09-13 20:07 ` Santosh Shilimkar
2014-09-13 20:07 ` 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   ` Santosh Shilimkar
2014-09-13 20:07   ` Santosh Shilimkar
2014-09-13 20:07 ` [PATCH v3 2/3] net: Add " Santosh Shilimkar
2014-09-13 20:07   ` Santosh Shilimkar
2014-09-15 16:37   ` David Miller
2014-09-15 16:37     ` David Miller
2014-09-15 16:37     ` David Miller
2014-09-16 13:44     ` Sandeep Nair [this message]
2014-09-16 13:44       ` Sandeep Nair
2014-09-16 13:44       ` Sandeep Nair
2014-09-24 19:51       ` Santosh Shilimkar
2014-09-24 19:51         ` Santosh Shilimkar
2014-09-24 19:51         ` Santosh Shilimkar
2014-09-24 20:43         ` David Miller
2014-09-24 20:43           ` David Miller
2014-09-24 20:43           ` David Miller
2014-09-25 13:43           ` Santosh Shilimkar
2014-09-25 13:43             ` Santosh Shilimkar
2014-09-25 13:43             ` Santosh Shilimkar
2014-09-13 20:07 ` [PATCH v3 3/3] MAINTAINER: net: Add TI NETCP Ethernet driver entry Santosh Shilimkar
2014-09-13 20:07   ` Santosh Shilimkar
2014-09-13 20:07   ` 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.com \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=grant.likely@linaro.org \
    --cc=jhs@mojatatu.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=santosh.shilimkar@ti.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.