diff options
Diffstat (limited to 'drivers/staging/comedi/drivers/jr3_pci.c')
-rw-r--r-- | drivers/staging/comedi/drivers/jr3_pci.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/staging/comedi/drivers/jr3_pci.c b/drivers/staging/comedi/drivers/jr3_pci.c index c0ae92217932..a21344e1a4c3 100644 --- a/drivers/staging/comedi/drivers/jr3_pci.c +++ b/drivers/staging/comedi/drivers/jr3_pci.c @@ -705,6 +705,9 @@ static int jr3_pci_auto_attach(struct comedi_device *dev, if (ret) return ret; + if (pci_resource_len(pcidev, 0) < board->n_subdevs * sizeof(*block)) + return -ENXIO; + dev->mmio = pci_ioremap_bar(pcidev, 0); if (!dev->mmio) return -ENOMEM; |