Staging: comedi: reorder check in pcmmio_attach()

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Sunday, March 7, 2010 - 6:00 pm

Gitweb:     http://git.kernel.org/linus/4b2ba24399cfcd7c80a20cd3bbedc5df0ebd4345
Commit:     4b2ba24399cfcd7c80a20cd3bbedc5df0ebd4345
Parent:     5d3aed742498ffe5692e3f974f3f7ea0e99a93bb
Author:     Dan Carpenter <error27@gmail.com>
AuthorDate: Mon Dec 28 18:59:01 2009 +0200
Committer:  Greg Kroah-Hartman <gregkh@suse.de>
CommitDate: Wed Mar 3 16:42:38 2010 -0800

    Staging: comedi: reorder check in pcmmio_attach()
    
    The check for dio_num_asics is used to determine if there is more than 1 irq.
    If it is false then irq[1] is past the end of the array.
    
    Signed-off-by: Dan Carpenter <error27@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/staging/comedi/drivers/pcmmio.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/comedi/drivers/pcmmio.c b/drivers/staging/comedi/drivers/pcmmio.c
index 35ba939..6ca4105 100644
--- a/drivers/staging/comedi/drivers/pcmmio.c
+++ b/drivers/staging/comedi/drivers/pcmmio.c
@@ -550,7 +550,7 @@ static int pcmmio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 
 	if (irq[0]) {
 		printk("irq: %u ", irq[0]);
-		if (irq[1] && thisboard->dio_num_asics == 2)
+		if (thisboard->dio_num_asics == 2 && irq[1])
 			printk("second ASIC irq: %u ", irq[1]);
 	} else {
 		printk("(IRQ mode disabled) ");
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Staging: comedi: reorder check in pcmmio_attach(), Linux Kernel Mailing ..., (Sun Mar 7, 6:00 pm)