lkml.org 
[lkml]   [2018]   [Dec]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v4] soc/fsl/qe: fix err handling of ucc_of_parse_tdm
From
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.

\
 
 \ /
  Last update: 2018-12-31 05:23    [W:0.034 / U:0.380 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site