Commit 84472ecd authored by Dan Carpenter's avatar Dan Carpenter Committed by Greg Kroah-Hartman

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: 23b028c8 ("staging: bcm2835-audio: initial staging submission")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1605cda0
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment