From: Clemens Ladisch Date: Sun, 25 Jan 2015 13:35:24 +0000 (+0100) Subject: ALSA: seq: fix off-by-one error in port limit check X-Git-Tag: firefly_0821_release~176^2~2367^2~39 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=de20b572a30ac3628602cbd17d2765bc3f2cb122;p=firefly-linux-kernel-4.4.55.git ALSA: seq: fix off-by-one error in port limit check Signed-off-by: Clemens Ladisch Signed-off-by: Takashi Iwai --- diff --git a/sound/core/seq/seq_ports.c b/sound/core/seq/seq_ports.c index 794a341bf0e5..52b279b7b030 100644 --- a/sound/core/seq/seq_ports.c +++ b/sound/core/seq/seq_ports.c @@ -134,7 +134,7 @@ struct snd_seq_client_port *snd_seq_create_port(struct snd_seq_client *client, if (snd_BUG_ON(!client)) return NULL; - if (client->num_ports >= SNDRV_SEQ_MAX_PORTS - 1) { + if (client->num_ports >= SNDRV_SEQ_MAX_PORTS) { pr_warn("ALSA: seq: too many ports for client %d\n", client->number); return NULL; }