All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Yu Kuai <yukuai3@huawei.com>
Cc: <madalin.bucur@nxp.com>, <davem@davemloft.net>,
	<florinel.iordache@nxp.com>, <netdev@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <yi.zhang@huawei.com>
Subject: Re: [PATCH V2] fsl/fman: add missing put_devcie() call in fman_port_probe()
Date: Wed, 4 Nov 2020 17:31:20 -0800	[thread overview]
Message-ID: <20201104173120.0c72d1b1@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> (raw)
In-Reply-To: <20201103112323.1077040-1-yukuai3@huawei.com>

On Tue, 3 Nov 2020 19:23:23 +0800 Yu Kuai wrote:
> --- a/drivers/net/ethernet/freescale/fman/fman_port.c
> +++ b/drivers/net/ethernet/freescale/fman/fman_port.c
> @@ -1792,20 +1792,21 @@ static int fman_port_probe(struct platform_device *of_dev)
>  	if (!fm_node) {
>  		dev_err(port->dev, "%s: of_get_parent() failed\n", __func__);
>  		err = -ENODEV;
> -		goto return_err;
> +		goto free_port;
>  	}
>  
> +	of_node_put(port_node);
>  	fm_pdev = of_find_device_by_node(fm_node);
>  	of_node_put(fm_node);
>  	if (!fm_pdev) {
>  		err = -EINVAL;
> -		goto return_err;
> +		goto free_port;
>  	}

This is not right either. I just asked you fix up the order of the
error path, not move the of_node_put() in the body of the function. 

Now you're releasing the reference on the object and still use it after.

  reply	other threads:[~2020-11-05  1:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-31 10:54 [PATCH] fsl/fman: add missing put_devcie() call in fman_port_probe() Yu Kuai
2020-11-03  1:30 ` Jakub Kicinski
2020-11-03 11:09   ` yukuai (C)
2020-11-03 11:23 ` [PATCH V2] " Yu Kuai
2020-11-05  1:31   ` Jakub Kicinski [this message]
2020-11-06 21:59     ` Madalin Bucur (OSS)
2020-11-07  9:09   ` [PATCH V3] " Yu Kuai
2020-11-07 22:09     ` Jakub Kicinski
2020-11-09 13:11       ` yukuai (C)

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=20201104173120.0c72d1b1@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com \
    --to=kuba@kernel.org \
    --cc=davem@davemloft.net \
    --cc=florinel.iordache@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=madalin.bucur@nxp.com \
    --cc=netdev@vger.kernel.org \
    --cc=yi.zhang@huawei.com \
    --cc=yukuai3@huawei.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.