This is a note to let you know that I've just added the patch titled
staging: comedi: amplc_pci224: Fix PCI ref count
to the 3.5-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
staging-comedi-amplc_pci224-fix-pci-ref-count.patch
and it can be found in the queue-3.5 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.
>From cadf84bfeb80e216fde328d357fe856160157d2c Mon Sep 17 00:00:00 2001
From: Ian Abbott <[email protected]>
Date: Mon, 3 Sep 2012 16:39:38 +0100
Subject: staging: comedi: amplc_pci224: Fix PCI ref count
From: Ian Abbott <[email protected]>
commit cadf84bfeb80e216fde328d357fe856160157d2c upstream.
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.
Signed-off-by: Ian Abbott <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
drivers/staging/comedi/drivers/amplc_pci224.c | 7 +++++++
1 file changed, 7 insertions(+)
--- a/drivers/staging/comedi/drivers/amplc_pci224.c
+++ b/drivers/staging/comedi/drivers/amplc_pci224.c
@@ -1519,6 +1519,13 @@ pci224_attach_pci(struct comedi_device *
dev->minor, DRIVER_NAME);
return -EINVAL;
}
+ /*
+ * Need to 'get' the PCI device to match the 'put' in pci224_detach().
+ * TODO: Remove the pci_dev_get() and matching pci_dev_put() once
+ * support for manual attachment of PCI devices via pci224_attach()
+ * has been removed.
+ */
+ pci_dev_get(pci_dev);
return pci224_attach_common(dev, pci_dev, NULL);
}
Patches currently in stable-queue which might be from [email protected] are
queue-3.5/staging-comedi-amplc_pci224-fix-pci-ref-count.patch
queue-3.5/staging-comedi-das08-correct-ai-encoding-for-das08jr-16-ao.patch
queue-3.5/staging-comedi-das08-correct-ao-output-for-das08jr-16-ao.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html