Ian Abbott cadf84bfeb staging: comedi: amplc_pci224: Fix PCI ref count
When attaching a PCI device manually via the comedi driver `attach` hook
(`pci224_attach()`) (called by the comedi core for the
`COMEDI_DEVCONFIG` ioctl), its reference count is incremented in the
`for_each_pci_dev` loop (in `pci224_find_pci_dev()`).  It is decremented
when the `detach` hook (`pci224_detach()`) is called to detach the
device.  However, when the PCI device is attached automatically via the
`attach_pci` hook (`pci224_attach_pci()`, called at probe time via
`comedi_pci_auto_config()`) it's reference count is not incremented so
there will be an unmatched decrement when detaching the device.

Increment the PCI device reference count in `pci224_attach_pci()` to
correct the mismatch.

Once support for manual configuration has been removed from this driver,
the calls to `pci_dev_get()` and `pci_dev_put()` can be removed.

Cc: stable <stable@vger.kernel.org> # 3.5.x
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-04 11:40:40 -07:00
..
2012-08-14 16:53:21 -07:00
2012-07-06 16:08:57 -07:00
2012-07-26 11:14:49 -07:00
2012-06-26 15:07:56 -07:00
2012-06-25 09:31:00 -07:00
2012-06-25 09:31:00 -07:00
2012-07-09 13:06:21 -07:00
2012-07-16 19:24:46 -07:00
2012-07-06 16:21:54 -07:00
2012-07-19 15:39:39 -07:00
2012-07-09 11:35:00 -07:00