OSDN Git Service

staging: comedi: jr3_pci: check PCI BAR 0 size
authorIan Abbott <abbotti@mev.co.uk>
Wed, 8 Mar 2017 18:44:31 +0000 (18:44 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 12 Mar 2017 13:57:00 +0000 (14:57 +0100)
commit8abde9acdfc82aacbfd96e65fe416c29c4856500
treeb13e813aed590748af697ff9cfd2b5786913117c
parent7cb1c5c2cd5fe2d4303eee415ca2ed207bd932a5
staging: comedi: jr3_pci: check PCI BAR 0 size

The various supported boards have different numbers of subdevices from 1
to 4.  Each subdevice needs a block of registers in PCI BAR 0.  Check
the region is large enough for the required number of subdevices.
Return an error from `jr3_pci_auto_attach()` if it is too small.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/jr3_pci.c