lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <bb9e239f-902b-4f52-a5e9-98c29b360418@linux.dev>
Date: Thu, 23 May 2024 15:21:48 -0400
From: Sean Anderson <sean.anderson@...ux.dev>
To: Markus Elfring <Markus.Elfring@....de>,
 linux-arm-kernel@...ts.infradead.org, linux-pci@...r.kernel.org,
 Krzysztof Wilczyński <kw@...ux.com>,
 Lorenzo Pieralisi <lpieralisi@...nel.org>, Rob Herring <robh@...nel.org>
Cc: LKML <linux-kernel@...r.kernel.org>,
 Bharat Kumar Gogada <bharat.kumar.gogada@...inx.com>,
 Bjorn Helgaas <bhelgaas@...gle.com>,
 Lorenzo Pieralisi <lorenzo.pieralisi@....com>,
 Michal Simek <michal.simek@....com>, Michal Simek <michal.simek@...inx.com>,
 Thippeswamy Havalige <thippeswamy.havalige@....com>
Subject: Re: [PATCH v3 5/7] PCI: xilinx-nwl: Clean up clock on probe
 failure/removal

On 5/23/24 15:18, Markus Elfring wrote:
>> Make sure we turn off the clock on probe failure and device removal.
> …
>> +++ b/drivers/pci/controller/pcie-xilinx-nwl.c
> …
>> @@ -817,11 +818,23 @@ static int nwl_pcie_probe(struct platform_device *pdev)
>>  		err = nwl_pcie_enable_msi(pcie);
>>  		if (err < 0) {
>>  			dev_err(dev, "failed to enable MSI support: %d\n", err);
>> -			return err;
>> +			goto err_clk;
>>  		}
>>  	}
>>
>> -	return pci_host_probe(bridge);
>> +	err = pci_host_probe(bridge);
>> +
>> +err_clk:
>> +	if (err)
>> +		clk_disable_unprepare(pcie->clk);
> 
> I suggest to use the label “disable_unprepare_clock” directly before this function call
> (in the if branch) so that a duplicate check would be avoided after some error cases.

Well if you want to avoid a check, we can just do

err = pci_host_probe(bridge);
if (!err)
	return 0;

err_clk:
	...

--Sean

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ