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

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
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);