diff options
author | H Hartley Sweeten <hartleys@visionengravers.com> | 2012-08-16 22:53:45 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-08-17 11:17:36 -0400 |
commit | c7ac601e1d744da6b213531eac140982c6821b6f (patch) | |
tree | 7075528dc1041241454f7e9dd1bc92867eaa8e68 | |
parent | 8496fc47e311b2ceeccb224d215baae86172d092 (diff) |
staging: comedi: cb_pcimdda: fix bug in call to subdev_8255_cleanup
The attach function only allocated 2 subdevices, an analog output
sundevice (index 0) and the 8255 dio subdevice (index 1). The
detach function is passing the wrong subdevice (index 2) to the
subdev_8255_cleanup function which will result in a bug when
it tries to do the kfree(s->private).
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/comedi/drivers/cb_pcimdda.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/comedi/drivers/cb_pcimdda.c b/drivers/staging/comedi/drivers/cb_pcimdda.c index b10831d3cf22..99a6160d3724 100644 --- a/drivers/staging/comedi/drivers/cb_pcimdda.c +++ b/drivers/staging/comedi/drivers/cb_pcimdda.c | |||
@@ -257,7 +257,7 @@ static void cb_pcimdda_detach(struct comedi_device *dev) | |||
257 | struct pci_dev *pcidev = comedi_to_pci_dev(dev); | 257 | struct pci_dev *pcidev = comedi_to_pci_dev(dev); |
258 | 258 | ||
259 | if (dev->subdevices) | 259 | if (dev->subdevices) |
260 | subdev_8255_cleanup(dev, dev->subdevices + 2); | 260 | subdev_8255_cleanup(dev, dev->subdevices + 1); |
261 | if (pcidev) { | 261 | if (pcidev) { |
262 | if (dev->iobase) | 262 | if (dev->iobase) |
263 | comedi_pci_disable(pcidev); | 263 | comedi_pci_disable(pcidev); |