Check NULL value for devpriv during detach callback
Signed-off-by: Prashant P. Shah <[email protected]>
---
drivers/staging/comedi/drivers/dyna_pci10xx.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/comedi/drivers/dyna_pci10xx.c b/drivers/staging/comedi/drivers/dyna_pci10xx.c
index 50abb6e..d8821b9 100644
--- a/drivers/staging/comedi/drivers/dyna_pci10xx.c
+++ b/drivers/staging/comedi/drivers/dyna_pci10xx.c
@@ -410,14 +410,12 @@ found:
static int dyna_pci10xx_detach(struct comedi_device *dev)
{
- if (devpriv->pci_dev)
+ if (devpriv && devpriv->pci_dev)
comedi_pci_disable(devpriv->pci_dev);
return 0;
}
-/* COMEDI_PCI_INITCLEANUP(dyna_pci10xx_driver, dyna_pci10xx_pci_table); */
-
static int __devinit driver_dyna_pci10xx_pci_probe(struct pci_dev *dev,
const struct pci_device_id *ent)
{
--
1.7.1