Re: [PATCH] phy: tegra: add missing put_device() call in tegra210_xusb_padctl_probe()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



07.12.2021 17:35, Dmitry Osipenko пишет:
> 07.12.2021 15:56, Qing Wang пишет:
>> From: Wang Qing <wangqing@xxxxxxxx>
>>
>> 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@xxxxxxxx>
>> ---
>>  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.



[Index of Archives]     [ARM Kernel]     [Linux ARM]     [Linux ARM MSM]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux