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: <da2de297-2c9c-4855-9fb7-553022538cde@kernel.org>
Date: Mon, 29 Sep 2025 08:00:19 +0200
From: Jiri Slaby <jirislaby@...nel.org>
To: Florian Eckert <fe@....tdt.de>
Cc: gregkh@...uxfoundation.org, kumaravel.thiagarajan@...rochip.com,
 tharunkumar.pasumarthi@...rochip.com, andriy.shevchenko@...ux.intel.com,
 pnewman@...necttech.com, angelogioacchino.delregno@...labora.com,
 peterz@...radead.org, yujiaoliang@...o.com, arnd@...nel.org,
 cang1@...e.co.uk, macro@...am.me.uk, schnelle@...ux.ibm.com,
 Eckert.Florian@...glemail.com, linux-kernel@...r.kernel.org,
 linux-serial@...r.kernel.org
Subject: Re: [PATCH] serial: 8250_pcilib: Replace deprecated PCI functions

On 26. 09. 25, 14:31, Florian Eckert wrote:
>>> Signed-off-by: Florian Eckert <fe@....tdt.de>
>> ...
>>> --- a/drivers/tty/serial/8250/8250_pci.c
>>> +++ b/drivers/tty/serial/8250/8250_pci.c
>>> @@ -165,7 +165,15 @@ static int
>>>   setup_port(struct serial_private *priv, struct uart_8250_port *port,
>>>          u8 bar, unsigned int offset, int regshift)
>>>   {
>>> -    return serial8250_pci_setup_port(priv->dev, port, bar, offset, 
>>> regshift);
>>> +    void __iomem *iomem = NULL;
>>> +
>>> +    if (pci_resource_flags(priv->dev, bar) & IORESOURCE_MEM) {
>>> +        iomem = pcim_iomap(priv->dev, bar, 0);
>>> +        if (IS_ERR(iomem))
>>> +            return -ENOMEM;
>>
>> Why not to propagate the error?
> 
> Most other calls in the kernel of this function return
> -ENOMEM on error. Therefore, I thought that this is the
> correct return value. I can fix that in v2 if you like.
> Let me know what you prefer.

Ugh, pcim_iomap() returns NULL on error, so the IS_ERR() check is all 
wrong. What other places in the kernel use IS_ERR()? They need fixing.

thanks,
-- 
js
suse labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ