All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: peng.hao2@zte.com.cn
Cc: qiang.zhao@nxp.com, leoyang.li@nxp.com,
	linux-kernel@vger.kernel.org, wen.yang99@zte.com.cn,
	julia.lawall@lip6.fr, netdev@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH v4] soc/fsl/qe: fix err handling of ucc_of_parse_tdm
Date: Sun, 30 Dec 2018 20:22:19 -0800 (PST)	[thread overview]
Message-ID: <20181230.202219.1041865778497322666.davem@davemloft.net> (raw)
In-Reply-To: <1546073252-98777-1-git-send-email-peng.hao2@zte.com.cn>

From: Peng Hao <peng.hao2@zte.com.cn>
Date: Sat, 29 Dec 2018 16:47:32 +0800

> +static struct resource *ucc_get_resource_by_nodename(char *name)
> +{
> +	struct device_node *np;
> +	struct platform_device *pdev;
> +
> +	np = of_find_compatible_node(NULL, NULL, name);
> +	if (!np)
> +		return ERR_PTR(-EINVAL);
> +
> +	pdev = of_find_device_by_node(np);
> +	if (!pdev) {
> +		pr_err("%pOFn: failed to lookup pdev\n", np);
> +		of_node_put(np);
> +		return ERR_PTR(-EINVAL);
> +	}
> +
> +	of_node_put(np);
> +	return platform_get_resource(pdev, IORESOURCE_MEM, 0);
> +}

"of_find_device_by_node()" takes a reference to the underlying device
structure, and you never release that reference.

I am very concerned about your submission because there are many
serious problems in it.  It is absolutely impossible for your v3 to
have been tested, and now this new v4 adds object reference leaks.

WARNING: multiple messages have this Message-ID (diff)
From: David Miller <davem@davemloft.net>
To: peng.hao2@zte.com.cn
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	leoyang.li@nxp.com, julia.lawall@lip6.fr,
	linuxppc-dev@lists.ozlabs.org, wen.yang99@zte.com.cn,
	qiang.zhao@nxp.com
Subject: Re: [PATCH v4] soc/fsl/qe: fix err handling of ucc_of_parse_tdm
Date: Sun, 30 Dec 2018 20:22:19 -0800 (PST)	[thread overview]
Message-ID: <20181230.202219.1041865778497322666.davem@davemloft.net> (raw)
In-Reply-To: <1546073252-98777-1-git-send-email-peng.hao2@zte.com.cn>

From: Peng Hao <peng.hao2@zte.com.cn>
Date: Sat, 29 Dec 2018 16:47:32 +0800

> +static struct resource *ucc_get_resource_by_nodename(char *name)
> +{
> +	struct device_node *np;
> +	struct platform_device *pdev;
> +
> +	np = of_find_compatible_node(NULL, NULL, name);
> +	if (!np)
> +		return ERR_PTR(-EINVAL);
> +
> +	pdev = of_find_device_by_node(np);
> +	if (!pdev) {
> +		pr_err("%pOFn: failed to lookup pdev\n", np);
> +		of_node_put(np);
> +		return ERR_PTR(-EINVAL);
> +	}
> +
> +	of_node_put(np);
> +	return platform_get_resource(pdev, IORESOURCE_MEM, 0);
> +}

"of_find_device_by_node()" takes a reference to the underlying device
structure, and you never release that reference.

I am very concerned about your submission because there are many
serious problems in it.  It is absolutely impossible for your v3 to
have been tested, and now this new v4 adds object reference leaks.

  reply	other threads:[~2018-12-31  4:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-29  8:47 [PATCH v4] soc/fsl/qe: fix err handling of ucc_of_parse_tdm Peng Hao
2018-12-29  8:47 ` Peng Hao
2018-12-31  4:22 ` David Miller [this message]
2018-12-31  4:22   ` David Miller

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=20181230.202219.1041865778497322666.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=julia.lawall@lip6.fr \
    --cc=leoyang.li@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=netdev@vger.kernel.org \
    --cc=peng.hao2@zte.com.cn \
    --cc=qiang.zhao@nxp.com \
    --cc=wen.yang99@zte.com.cn \
    /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.