summaryrefslogtreecommitdiffstats
path: root/drivers/mfd/rc5t583-irq.c
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@ingics.com>2012-11-20 03:34:56 +0100
committerSamuel Ortiz <sameo@linux.intel.com>2012-11-26 12:10:51 +0100
commit3f9be35bd9090eaa2f68ed9b24efdbf3abcf4b28 (patch)
treeb2a5647e0f05fb5415f315a24700d12ccfa9b2ff /drivers/mfd/rc5t583-irq.c
parentmfd: viperboard: Do version query in dma memory (diff)
downloadlinux-3f9be35bd9090eaa2f68ed9b24efdbf3abcf4b28.tar.xz
linux-3f9be35bd9090eaa2f68ed9b24efdbf3abcf4b28.zip
mfd: rc5t583: Fix array subscript is above array bounds
I got below build warning while compiling this driver. It's obviously RC5T583_MAX_INTERRUPT_MASK_REGS is 9 but irq_en_add array only has 8 elements. CC drivers/mfd/rc5t583-irq.o drivers/mfd/rc5t583-irq.c: In function 'rc5t583_irq_sync_unlock': drivers/mfd/rc5t583-irq.c:227: warning: array subscript is above array bounds drivers/mfd/rc5t583-irq.c: In function 'rc5t583_irq_init': drivers/mfd/rc5t583-irq.c:349: warning: array subscript is above array bounds Since the number of interrupt enable registers is 8, this patch adds define for RC5T583_MAX_INTERRUPT_EN_REGS to fix this bug. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd/rc5t583-irq.c')
-rw-r--r--drivers/mfd/rc5t583-irq.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mfd/rc5t583-irq.c b/drivers/mfd/rc5t583-irq.c
index fe00cdd6f83d..b41db5968706 100644
--- a/drivers/mfd/rc5t583-irq.c
+++ b/drivers/mfd/rc5t583-irq.c
@@ -345,7 +345,7 @@ int rc5t583_irq_init(struct rc5t583 *rc5t583, int irq, int irq_base)
mutex_init(&rc5t583->irq_lock);
/* Initailize all int register to 0 */
- for (i = 0; i < RC5T583_MAX_INTERRUPT_MASK_REGS; i++) {
+ for (i = 0; i < RC5T583_MAX_INTERRUPT_EN_REGS; i++) {
ret = rc5t583_write(rc5t583->dev, irq_en_add[i],
rc5t583->irq_en_reg[i]);
if (ret < 0)