Skip to content

Commit

Permalink
staging: comedi: 8255: check for failure of subdev_8255_init
Browse files Browse the repository at this point in the history
The initialization of the 8255 subdevice can fail. Make sure to
check for it.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Jun 14, 2012
1 parent 34cfcf9 commit 3e189f0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/staging/comedi/drivers/8255.c
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ int subdev_8255_init_irq(struct comedi_device *dev, struct comedi_subdevice *s,
int ret;

ret = subdev_8255_init(dev, s, io, iobase);
if (ret < 0)
if (ret)
return ret;

s->do_cmdtest = subdev_8255_cmdtest;
Expand Down Expand Up @@ -399,7 +399,9 @@ static int dev_8255_attach(struct comedi_device *dev,

s->type = COMEDI_SUBD_UNUSED;
} else {
subdev_8255_init(dev, s, NULL, iobase);
ret = subdev_8255_init(dev, s, NULL, iobase);
if (ret)
return ret;
dev_info(dev->class_dev, "0x%04lx\n", iobase);
}
}
Expand Down

0 comments on commit 3e189f0

Please sign in to comment.