Thread (24 messages) 24 messages, 8 authors, 2020-07-16

Re: [RFC PATCH 00/35] Move all PCIBIOS* definitions into arch/x86

From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Date: 2020-07-15 22:30:18
Also in: linux-kernel-mentees, linux-pci, lkml, sparclinux

On Wed, 2020-07-15 at 08:47 +0200, Arnd Bergmann wrote:
drivers/misc/cardreader/rts5261.c:      retval =
rtsx_pci_write_config_dword(pcr, PCR_SETTING_REG2, lval);

That last one is interesting because I think this is a case in which
we
actually want to check for errors, as the driver seems to use it
to ensure that accessing extended config space at offset 0x814
works before relying on the value. Unfortunately the implementation
seems buggy as it a) keeps using the possibly uninitialized value
after
printing a warning and b) returns the PCIBIOS_* value in place of a
negative errno and then ignores it in the caller.
In cases like this, usually checking against ~0 is sufficient

Cheers,
Ben.

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help