diff options
author | H Hartley Sweeten <hartleys@visionengravers.com> | 2012-06-12 11:59:33 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-06-12 14:44:04 -0700 |
commit | 8b6c56949ffa83dbc2a6e8fa3f98b10a19372207 (patch) | |
tree | 71fb0a053eca4f23efdca55f479554ba037ee987 /drivers/staging/comedi/drivers/cb_pcidas64.c | |
parent | eea6838b1206b0ac90110f1a6f58e101aa496e99 (diff) | |
download | linux-rt-8b6c56949ffa83dbc2a6e8fa3f98b10a19372207.tar.gz |
staging: comedi: propogate error code from comedi_alloc_subdevices
comedi_alloc_subdevices can fail with -EINVAL or -ENOMEM. When it
does fail make sure to pass the proper error code back.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbott@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/comedi/drivers/cb_pcidas64.c')
-rw-r--r-- | drivers/staging/comedi/drivers/cb_pcidas64.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/staging/comedi/drivers/cb_pcidas64.c b/drivers/staging/comedi/drivers/cb_pcidas64.c index 6b2f153980a9..3aab75b5217d 100644 --- a/drivers/staging/comedi/drivers/cb_pcidas64.c +++ b/drivers/staging/comedi/drivers/cb_pcidas64.c @@ -1344,9 +1344,11 @@ static int setup_subdevices(struct comedi_device *dev) struct comedi_subdevice *s; void __iomem *dio_8255_iobase; int i; + int ret; - if (comedi_alloc_subdevices(dev, 10) < 0) - return -ENOMEM; + ret = comedi_alloc_subdevices(dev, 10); + if (ret) + return ret; s = dev->subdevices + 0; /* analog input subdevice */ |