mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dmitry Osipenko <digetx@gmail.com>
To: Qing Wang <wangqing@vivo.com>, JC Kuo <jckuo@nvidia.com>,
	Kishon Vijay Abraham I <kishon@ti.com>,
	Vinod Koul <vkoul@kernel.org>,
	Thierry Reding <thierry.reding@gmail.com>,
	Jonathan Hunter <jonathanh@nvidia.com>,
	linux-phy@lists.infradead.org, linux-tegra@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] phy: tegra: add missing put_device() call in tegra210_xusb_padctl_probe()
Date: Tue, 7 Dec 2021 17:37:48 +0300	[thread overview]
Message-ID: <e57c1c99-0743-c785-24e3-44654e4991f1@gmail.com> (raw)
In-Reply-To: <b56a0b92-cf64-570c-08f8-e7a54fc55946@gmail.com>

07.12.2021 17:35, Dmitry Osipenko пишет:
> 07.12.2021 15:56, Qing Wang пишет:
>> From: Wang Qing <wangqing@vivo.com>
>>
>> of_find_device_by_node() takes a reference to the embedded struct device 
>> which needs to be dropped when error return.
>>
>> Signed-off-by: Wang Qing <wangqing@vivo.com>
>> ---
>>  drivers/phy/tegra/xusb-tegra210.c | 4 +++-
>>  1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/phy/tegra/xusb-tegra210.c b/drivers/phy/tegra/xusb-tegra210.c
>> index eedfc7c..05a0800
>> --- a/drivers/phy/tegra/xusb-tegra210.c
>> +++ b/drivers/phy/tegra/xusb-tegra210.c
>> @@ -3170,8 +3170,10 @@ tegra210_xusb_padctl_probe(struct device *dev,
>>  		goto out;
>>  	}
>>  
>> -	if (!platform_get_drvdata(pdev))
>> +	if (!platform_get_drvdata(pdev)) {
>> +		put_device(&pdev->dev);
>>  		return ERR_PTR(-EPROBE_DEFER);
>> +	}
>>  
>>  	padctl->regmap = dev_get_regmap(&pdev->dev, "usb_sleepwalk");
>>  	if (!padctl->regmap)
>>
> 
> What if dev_get_regmap() fails? What if driver is removed?
> 
> Please either fix it properly or don't fix it.
> 

My bad, I see now in the code that this dev_get_regmap() fail is okay.
Nevertheless the driver removal is incorrect.

      reply	other threads:[~2021-12-07 14:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-07 12:56 Qing Wang
2021-12-07 14:35 ` Dmitry Osipenko
2021-12-07 14:37   ` Dmitry Osipenko [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=e57c1c99-0743-c785-24e3-44654e4991f1@gmail.com \
    --to=digetx@gmail.com \
    --cc=jckuo@nvidia.com \
    --cc=jonathanh@nvidia.com \
    --cc=kishon@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=thierry.reding@gmail.com \
    --cc=vkoul@kernel.org \
    --cc=wangqing@vivo.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®