staging: comedi: me_daq: fix pointer dereference in me_detach()
authorH Hartley Sweeten <hartleys@visionengravers.com>
Thu, 25 Oct 2012 22:05:46 +0000 (15:05 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 26 Oct 2012 16:20:00 +0000 (09:20 -0700)
commit736b605c897204b8c05f15160f12e70c61b2e6e6
tree63819ed387418e20a1492c9142dd98e23e698c18
parent0014048e091da8bfdbe6f5a15d4045d3747d1335
staging: comedi: me_daq: fix pointer dereference in me_detach()

As pointed out by Dan Carpenter, dev_private could be NULL when it
is checked before calling comedi_pci_disable(). The private data
variable 'plx_regbase_size' is only used to see if the pci device
has been enabled.

Remove that variable from the private data and just use the unused
dev->iobase variable to let the detach know that the pci device
is enabled.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/me_daq.c