[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20181230.202219.1041865778497322666.davem@davemloft.net>
Date: Sun, 30 Dec 2018 20:22:19 -0800 (PST)
From: David Miller <davem@...emloft.net>
To: peng.hao2@....com.cn
Cc: qiang.zhao@....com, leoyang.li@....com,
linux-kernel@...r.kernel.org, wen.yang99@....com.cn,
julia.lawall@...6.fr, netdev@...r.kernel.org,
linuxppc-dev@...ts.ozlabs.org
Subject: Re: [PATCH v4] soc/fsl/qe: fix err handling of ucc_of_parse_tdm
From: Peng Hao <peng.hao2@....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.
Powered by blists - more mailing lists