From 915a71a2cdf6361f0fc77fa367a67910dc0288db Mon Sep 17 00:00:00 2001
From: Takashi Iwai <tiwai@suse.de>
Date: Sat, 4 Nov 2023 10:05:39 +0100
Subject: [PATCH] seq: Fix invalid sanity-check in
 snd_seq_set_input_buffer_size()

snd_seq_set_input_buffer_size() has an assert() call with packet_size,
but it's still uninitialized at that point.  Fix it with the real
packet size.

Fixes: 2aefb5c41cc0 ("seq: Add UMP support")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 src/seq/seq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/seq/seq.c b/src/seq/seq.c
index fd8ca30e2472..5ec737a7004f 100644
--- a/src/seq/seq.c
+++ b/src/seq/seq.c
@@ -1269,9 +1269,9 @@ int snd_seq_set_input_buffer_size(snd_seq_t *seq, size_t size)
 	size_t packet_size;
 
 	assert(seq && seq->ibuf);
+	packet_size = get_packet_size(seq);
 	assert(size >= packet_size);
 	snd_seq_drop_input(seq);
-	packet_size = get_packet_size(seq);
 	size = (size + packet_size - 1) / packet_size;
 	if (size != seq->ibufsize) {
 		char *newbuf;
-- 
2.35.3

