]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
vDPA/ifcvf: Fix pci_read_config_byte() return code handling
authorYuan Can <yuancan@huawei.com>
Thu, 17 Oct 2024 01:38:12 +0000 (09:38 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 17 Nov 2024 14:06:25 +0000 (15:06 +0100)
commit8004122bf90ea3406be4a9d01fe255ffd3f297e2
treeb87c676af77b91e43663cbb90414a09f8041a8ee
parent79c12f418ececd0073a10ff33c2c46f127e2af7c
vDPA/ifcvf: Fix pci_read_config_byte() return code handling

[ Upstream commit 7f8825b2a78ac392d3fbb3a2e65e56d9e39d75e9 ]

ifcvf_init_hw() uses pci_read_config_byte() that returns
PCIBIOS_* codes. The error handling, however, assumes the codes are
normal errnos because it checks for < 0.
Convert the error check to plain non-zero check.

Fixes: 5a2414bc454e ("virtio: Intel IFC VF driver for VDPA")
Signed-off-by: Yuan Can <yuancan@huawei.com>
Message-Id: <20241017013812.129952-1-yuancan@huawei.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Acked-by: Zhu Lingshan <lingshan.zhu@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/vdpa/ifcvf/ifcvf_base.c