summaryrefslogtreecommitdiffstats
path: root/drivers/staging/bcm2835-audio
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2017-02-07 16:17:07 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-02-09 13:16:45 +0100
commit84472ecd7074576143aaf2772a304138fa4f1a09 (patch)
tree06b105d3dde0a5075dde49a2e3a63bc0645032ba /drivers/staging/bcm2835-audio
parent1605cda06ba58f1b3b9570ae9ea13e9793aeca2a (diff)
downloadop-kernel-dev-84472ecd7074576143aaf2772a304138fa4f1a09.zip
op-kernel-dev-84472ecd7074576143aaf2772a304138fa4f1a09.tar.gz
staging: bcm2835-audio: off by one in snd_bcm2835_playback_open_generic()
The > should be >= otherwise we write beyond the end of the array when we do: chip->alsa_stream[idx] = alsa_stream; Fixes: 23b028c871e1 ("staging: bcm2835-audio: initial staging submission") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/bcm2835-audio')
-rw-r--r--drivers/staging/bcm2835-audio/bcm2835-pcm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/bcm2835-audio/bcm2835-pcm.c b/drivers/staging/bcm2835-audio/bcm2835-pcm.c
index d2d9f9b..014bf7a 100644
--- a/drivers/staging/bcm2835-audio/bcm2835-pcm.c
+++ b/drivers/staging/bcm2835-audio/bcm2835-pcm.c
@@ -130,7 +130,7 @@ static int snd_bcm2835_playback_open_generic(
err = -EBUSY;
goto out;
}
- if (idx > MAX_SUBSTREAMS) {
+ if (idx >= MAX_SUBSTREAMS) {
audio_error
("substream(%d) device doesn't exist max(%d) substreams allowed\n",
idx, MAX_SUBSTREAMS);
OpenPOWER on IntegriCloud