mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "yukuai (C)" <yukuai3@huawei.com>
To: Jakub Kicinski <kuba@kernel.org>
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 V3] fsl/fman: add missing put_devcie() call in fman_port_probe()
Date: Mon, 9 Nov 2020 21:11:12 +0800	[thread overview]
Message-ID: <0efa4731-67d7-fe7a-54ab-a3d3493ad936@huawei.com> (raw)
In-Reply-To: <20201107140953.1f04c04e@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>

在 2020/11/08 6:09, Jakub Kicinski 写道:
> On Sat, 7 Nov 2020 17:09:25 +0800 Yu Kuai wrote:
>> if of_find_device_by_node() succeed, fman_port_probe() doesn't have a
>> corresponding put_device(). Thus add jump target to fix the exception
>> handling for this function implementation.
>>
>> Fixes: 0572054617f3 ("fsl/fman: fix dereference null return value")
>> Signed-off-by: Yu Kuai <yukuai3@huawei.com>
> 
>> @@ -1792,20 +1792,20 @@ 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;
> 
> And now you no longer put port_node if jumping from here...

Sincerely apologize for that stupid mistake...

> 
> Also does the reference to put_device() not have to be released when
> this function succeeds?
> 

I'm not sure about that, since fman_port_driver doesn't define other
interface, maybe it reasonable to release it here.

>>   	}
> 
>> @@ -1896,7 +1895,9 @@ static int fman_port_probe(struct platform_device *of_dev)
>>   
>>   	return 0;
>>   
>> -return_err:
>> +put_device:
>> +	put_device(&fm_pdev->dev);
>> +put_node:
>>   	of_node_put(port_node);
>>   free_port:
>>   	kfree(port);
> 
> .
> 

      reply	other threads:[~2020-11-09 13:11 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-31 10:54 [PATCH] " 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
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) [this message]

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=0efa4731-67d7-fe7a-54ab-a3d3493ad936@huawei.com \
    --to=yukuai3@huawei.com \
    --cc=davem@davemloft.net \
    --cc=florinel.iordache@nxp.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=madalin.bucur@nxp.com \
    --cc=netdev@vger.kernel.org \
    --cc=yi.zhang@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®