]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
s390/pci: fix misleading rc in clp_set_pci_fn()
authorNiklas Schnelle <schnelle@linux.ibm.com>
Wed, 21 Jul 2021 17:58:54 +0000 (19:58 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 15 Sep 2021 08:00:31 +0000 (10:00 +0200)
commit17c565f6031149e79b1f23942e63c002ef8dc358
treec27e171bdac8c5393e15134e7bd8e0c1ce85c7db
parent72d9005f11ebfb6c056dd9c906b205cb93a958da
s390/pci: fix misleading rc in clp_set_pci_fn()

[ Upstream commit f7addcdd527a6dddfebe20c358b87bdb95624612 ]

Currently clp_set_pci_fn() always returns 0 as long as the CLP request
itself succeeds even if the operation itself returns a response code
other than CLP_RC_OK or CLP_RC_SETPCIFN_ALRDY. This is highly misleading
because calling code assumes that a zero rc means that the operation was
successful.

Fix this by returning the response code or cc on failure with the
exception of the special handling for CLP_RC_SETPCIFN_ALRDY. Also let's
not assume that the returned function handle for CLP_RC_SETPCIFN_ALRDY
is 0, we don't need it anyway.

Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>
Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/s390/pci/pci.c
arch/s390/pci/pci_clp.c