Skip to content

Commit

Permalink
staging: comedi: cb_pcimdda: fix bug in call to subdev_8255_cleanup
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Aug 17, 2012
1 parent 8496fc4 commit c7ac601
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/staging/comedi/drivers/cb_pcimdda.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ static void cb_pcimdda_detach(struct comedi_device *dev)
struct pci_dev *pcidev = comedi_to_pci_dev(dev);

if (dev->subdevices)
subdev_8255_cleanup(dev, dev->subdevices + 2);
subdev_8255_cleanup(dev, dev->subdevices + 1);
if (pcidev) {
if (dev->iobase)
comedi_pci_disable(pcidev);
Expand Down

0 comments on commit c7ac601

Please sign in to comment.