Fixed setting of comedi_errno in comedi_dio_config() for invalid
authorFrank Mori Hess <fmhess@speakeasy.net>
Sat, 1 Dec 2007 15:54:08 +0000 (15:54 +0000)
committerFrank Mori Hess <fmhess@speakeasy.net>
Sat, 1 Dec 2007 15:54:08 +0000 (15:54 +0000)
arguments.

lib/dio.c

index 65b07a42295232c9dd8cdb70195d78b163a53814..5d5cb08deef015e31b2087ea0e15f076b63faa86 100644 (file)
--- a/lib/dio.c
+++ b/lib/dio.c
@@ -43,12 +43,14 @@ int _comedi_dio_config(comedi_t *it,unsigned int subdev,unsigned int chan,unsign
                return -1;
 
        s=it->subdevices+subdev;
-       if(s->type!=COMEDI_SUBD_DIO)
+       if(s->type!=COMEDI_SUBD_DIO){
+               internal_error(EINVAL_SUBD);
                return -1;
-
-       if(io!=COMEDI_INPUT && io!=COMEDI_OUTPUT)
+       }
+       if(io!=COMEDI_INPUT && io!=COMEDI_OUTPUT){
+               internal_error(EINVAL);
                return -1;
-
+       }
        if(it->has_insnlist_ioctl){
                comedi_insn insn;
                lsampl_t data;