Skip to content

Commit

Permalink
Staging: comedi: reorder check in pcmmio_attach()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dan Carpenter authored and Greg Kroah-Hartman committed Mar 4, 2010
1 parent 5d3aed7 commit 4b2ba24
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/staging/comedi/drivers/pcmmio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) ");
Expand Down

0 comments on commit 4b2ba24

Please sign in to comment.