From: Sreeraj S Kurup <sreekuttan2156239@gmail.com>
To: perex@perex.cz, tiwai@suse.de
Cc: linux-kernel@vger.kernel.org, linux-sound@vger.kernel.org,
Sreeraj S Kurup <sreekuttan2156239@gmail.com>
Subject: [PATCH] ALSA: hda: Fix shortname truncation warning
Date: Wed, 2 Dec 2026 08:39:16 +0000 [thread overview]
Message-ID: <20261202083916.3399-1-sreekuttan2156239@gmail.com> (raw)
The shortname truncation check uses '>' instead of '>='.
As a result, the warning is skipped when the source string
length exactly matches the destination buffer size.
Use '>=' to correctly detect this truncation case.
Signed-off-by: Sreeraj S Kurup <sreekuttan2156239@gmail.com>
---
sound/hda/controllers/acpi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/hda/controllers/acpi.c b/sound/hda/controllers/acpi.c
index 8ec7728ae81e..957577bb6566 100644
--- a/sound/hda/controllers/acpi.c
+++ b/sound/hda/controllers/acpi.c
@@ -136,7 +136,7 @@ static int hda_acpi_init(struct hda_acpi *hda)
sname = hda->data->short_name ? hda->data->short_name : KBUILD_MODNAME;
- if (strlen(sname) > sizeof(card->shortname))
+ if (strlen(sname) >= sizeof(card->shortname))
dev_info(dev, "truncating shortname for card %s\n", sname);
strscpy(card->shortname, sname);
--
2.55.0
reply other threads:[~2026-12-02 8:40 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20261202083916.3399-1-sreekuttan2156239@gmail.com \
--to=sreekuttan2156239@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=perex@perex.cz \
--cc=tiwai@suse.de \
/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®