mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Prashant P. Shah" <pshah.mumbai@gmail.com>
To: devel@linuxdriverproject.org
Cc: Greg Kroah-Hartman <gregkh@suse.de>,
	Frank Mori Hess <fmhess@users.sourceforge.net>,
	Ian Abbott <abbotti@mev.co.uk>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 2/2] Staging: comedi: dyna_pci10xx: check for NULL value
Date: Thu, 9 Jun 2011 17:30:30 +0530	[thread overview]
Message-ID: <20110609120030.GA15307@mail.fossee.in> (raw)

Check NULL value for devpriv during detach callback

Signed-off-by: Prashant P. Shah <pshah.mumbai@gmail.com>
---
 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


                 reply	other threads:[~2011-06-09 11:46 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110609120030.GA15307@mail.fossee.in \
    --to=pshah.mumbai@gmail.com \
    --cc=abbotti@mev.co.uk \
    --cc=devel@linuxdriverproject.org \
    --cc=fmhess@users.sourceforge.net \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®