ASoC: msm: Fix potential array index out of bounds issue

Array 'dai' of size 9 may use index value(s) 9.
There is a chance of return 9 by dai_find_dma_channel()

Change-Id: I073baf5bf98b7c5db6e9fa3b31a6053167db241d
Signed-off-by: Jaiju Yesudasan <cjaijuy@codeaurora.org>
This commit is contained in:
Jaiju Yesudasan 2016-03-23 15:07:05 +05:30 committed by ShevT
parent 68c41d652e
commit 692c3477ae
1 changed files with 2 additions and 2 deletions

View File

@ -1,4 +1,4 @@
/* Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
/* Copyright (c) 2010-2011,2014,2016, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@ -57,7 +57,7 @@ static int dai_find_dma_channel(uint32_t intrsrc)
int i, dma_channel = 0;
pr_debug("%s\n", __func__);
for (i = 0; i <= 27; i += 3) {
for (i = 0; i < 27; i += 3) {
if (intrsrc & (1 << i)) {
dma_channel = i / 3;
break;