diff options
| author | Paolo Bonzini <pbonzini@redhat.com> | 2022-06-09 09:45:00 -0400 |
|---|---|---|
| committer | Paolo Bonzini <pbonzini@redhat.com> | 2022-06-09 09:45:00 -0400 |
| commit | 66da65005aa819e0b8d3a08f5ec1491b7690cb67 (patch) | |
| tree | 001471fc80938e6e13c6ecf356503d4c65043d5a /drivers/fpga/dfl-pci.c | |
| parent | 6cd88243c7e03845a450795e134b488fc2afb736 (diff) | |
| parent | 1a12b25274b9e54b0d2d59e21620f8cf13b268cb (diff) | |
Merge tag 'kvm-riscv-fixes-5.19-1' of https://github.com/kvm-riscv/linux into HEAD
KVM/riscv fixes for 5.19, take #1
- Typo fix in arch/riscv/kvm/vmid.c
- Remove broken reference pattern from MAINTAINERS entry
Diffstat (limited to 'drivers/fpga/dfl-pci.c')
| -rw-r--r-- | drivers/fpga/dfl-pci.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/fpga/dfl-pci.c b/drivers/fpga/dfl-pci.c index 717ac9715970..fd1fa55c9113 100644 --- a/drivers/fpga/dfl-pci.c +++ b/drivers/fpga/dfl-pci.c @@ -259,6 +259,15 @@ static int find_dfls_by_default(struct pci_dev *pcidev, */ bar = FIELD_GET(FME_PORT_OFST_BAR_ID, v); offset = FIELD_GET(FME_PORT_OFST_DFH_OFST, v); + if (bar == FME_PORT_OFST_BAR_SKIP) { + continue; + } else if (bar >= PCI_STD_NUM_BARS) { + dev_err(&pcidev->dev, "bad BAR %d for port %d\n", + bar, i); + ret = -EINVAL; + break; + } + start = pci_resource_start(pcidev, bar) + offset; len = pci_resource_len(pcidev, bar) - offset; |
