mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Aibing Chen <chenaibing@cmss.chinamobile.com>
To: Takashi Iwai <tiwai@suse.com>, Jaroslav Kysela <perex@perex.cz>
Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] ALSA: hdsp: enlarge the MIDI name buffer
Date: Sat, 14 Nov 2026 21:02:20 +0800	[thread overview]
Message-ID: <20261114130220.142-1-chenaibing@cmss.chinamobile.com> (raw)

snd_hdsp_create_midi() formats "<card shortname> MIDI <n>" into a 40
byte buffer.  The card shortname can be up to 31 characters, " MIDI "
adds 6 and the MIDI number up to 11, so the name can reach 48
characters plus the terminator.

Building with W=1 reports a -Wformat-truncation warning: the output can
reach 49 bytes including the terminator into a destination of size 40.
Only the rawmidi device name is affected, so nothing changes apart from
the name no longer being cut short.

Signed-off-by: Aibing Chen <chenaibing@cmss.chinamobile.com>
---
 sound/pci/rme9652/hdsp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/pci/rme9652/hdsp.c b/sound/pci/rme9652/hdsp.c
index 7dce548b9..ba5c8bf0f 100644
--- a/sound/pci/rme9652/hdsp.c
+++ b/sound/pci/rme9652/hdsp.c
@@ -1482,7 +1482,7 @@ static const struct snd_rawmidi_ops snd_hdsp_midi_input =
 
 static int snd_hdsp_create_midi (struct snd_card *card, struct hdsp *hdsp, int id)
 {
-	char buf[40];
+	char buf[64];
 
 	hdsp->midi[id].id = id;
 	hdsp->midi[id].rmidi = NULL;



             reply	other threads:[~2026-11-14 13:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-14 13:02 Aibing Chen [this message]
2026-11-16 14:31 ` Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261114130220.142-1-chenaibing@cmss.chinamobile.com \
    --to=chenaibing@cmss.chinamobile.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®