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] [day] [month] [year] [list]
Message-ID: <f45d5e6d-ab82-f86b-8afc-414e7c1fd28f@omp.ru>
Date: Wed, 18 Sep 2024 15:35:14 +0300
From: Sergey Shtylyov <s.shtylyov@....ru>
To: Markus Elfring <Markus.Elfring@....de>, <linux-ide@...r.kernel.org>,
	Damien Le Moal <dlemoal@...nel.org>, Niklas Cassel <cassel@...nel.org>
CC: LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] ata: pata_octeon_cf: Use common error handling code in
 octeon_cf_probe()

On 9/17/24 23:44, Sergey Shtylyov wrote:
[...]

>>> From: Markus Elfring <elfring@...rs.sourceforge.net>
>>> Date: Tue, 17 Sep 2024 13:43:24 +0200
>>>
>>> Add a label so that a bit of exception handling can be better reused
>>
>>    s/exception/error/.
>>
>>> in a subsequent if branch of this function implementation.
>>>
>>> This issue was detected by using the Coccinelle software.
>>>
>>> Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
>>> ---
>>>  drivers/ata/pata_octeon_cf.c | 9 ++++-----
>>>  1 file changed, 4 insertions(+), 5 deletions(-)
>>>
>>> diff --git a/drivers/ata/pata_octeon_cf.c b/drivers/ata/pata_octeon_cf.c
>>> index 0bb9607e7348..62289f6aef95 100644
>>> --- a/drivers/ata/pata_octeon_cf.c
>>> +++ b/drivers/ata/pata_octeon_cf.c
>>> @@ -848,14 +848,13 @@ static int octeon_cf_probe(struct platform_device *pdev)
>>>  				struct resource *res_dma;
>>>  				int i;
>>>  				res_dma = platform_get_resource(dma_dev, IORESOURCE_MEM, 0);
>>> -				if (!res_dma) {
>>> -					put_device(&dma_dev->dev);
>>> -					of_node_put(dma_node);
>>> -					return -EINVAL;
>>> -				}
>>> +				if (!res_dma)
>>> +					goto put_device;
>>> +
>>>  				cf_port->dma_base = (u64)devm_ioremap(&pdev->dev, res_dma->start,
>>>  									 resource_size(res_dma));
>>>  				if (!cf_port->dma_base) {
>>> +put_device:
>>
>>    Ugh... :-/
>>    Please use the new-fangled *devm_platform_ioremap_resource() instead of those

    Ugh, s/*//...

>> old-fashioned APIs.
> 
>    Another option is to place this error patch somewhere at the end

   s/patch/path/, of course... :-)

> of this function but I think I prefer the new APIs.

[...]

MBR, Sergey

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ