Staging: comedi: off by one in doDevConfig()
authorDan Carpenter <error27@gmail.com>
Mon, 28 Dec 2009 16:57:51 +0000 (18:57 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 4 Mar 2010 00:42:38 +0000 (16:42 -0800)
Changed > to >= to avoid array overflow.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/comedi/drivers/comedi_bond.c

index cf39a24..d7260cc 100644 (file)
@@ -417,7 +417,7 @@ static int doDevConfig(struct comedi_device *dev, struct comedi_devconfig *it)
                int sdev = -1, nchans, tmp;
                struct BondedDevice *bdev = NULL;
 
-               if (minor < 0 || minor > COMEDI_NUM_BOARD_MINORS) {
+               if (minor < 0 || minor >= COMEDI_NUM_BOARD_MINORS) {
                        ERROR("Minor %d is invalid!\n", minor);
                        return 0;
                }