]> git.baikalelectronics.ru Git - kernel.git/commit
Staging: VME: PIO2: Correct irq reset
authorMartyn Welch <martyn.welch@ge.com>
Tue, 29 Nov 2011 13:28:05 +0000 (13:28 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 30 Nov 2011 10:37:33 +0000 (19:37 +0900)
commitfee951dcca1de61b3e7e07a7c14eabb20b06e61b
tree0dc3c03caf3ba91f49802d13977b1bae309cef3d
parent838ce61fce4ae4c9e790b2369f3b2c8c2fc2b0b0
Staging: VME: PIO2: Correct irq reset

The loop used to reset the interrupt masks has faulty logic. There are 4
banks of 8 I/O, however each mask is comprised of 2 bits and thus there are
8 sets of registers to clear. Driver was wrongly equating this with 8 banks
leading to a us writing past the end of the "bank" array (used to store mask
configuration as these registers are write only) and thus causing memory
corruption. Clear both registers of masks for each bank and half iterations.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Martyn Welch <martyn.welch@ge.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/vme/devices/vme_pio2_gpio.c