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:
parent
68c41d652e
commit
692c3477ae
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue