From: Sreeraj S Kurup <sreekuttan2156239@gmail.com>
To: cix-kernel-upstream@cixtech.com, fugang.duan@cixtech.com,
gary.yang@cixtech.com, perex@perex.cz, tiwai@suse.de
Cc: linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-sound@vger.kernel.org,
Sreeraj S Kurup <sreekuttan2156239@gmail.com>
Subject: [PATCH] ALSA: hda: cix-ipbloq: Fix shortname truncation warning
Date: Wed, 2 Dec 2026 13:22:27 +0000 [thread overview]
Message-ID: <20261202132227.2781-1-sreekuttan2156239@gmail.com> (raw)
The shortname truncation check uses '>' instead of '>='.
When the source string length exactly matches the destination
buffer size, strscpy() truncates the string, but the warning
is not printed.
Use '>=' to correctly detect this truncation case.
Signed-off-by: Sreeraj S Kurup <sreekuttan2156239@gmail.com>
---
sound/hda/controllers/cix-ipbloq.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/hda/controllers/cix-ipbloq.c b/sound/hda/controllers/cix-ipbloq.c
index f73d6216bce3..2deaba95591f 100644
--- a/sound/hda/controllers/cix-ipbloq.c
+++ b/sound/hda/controllers/cix-ipbloq.c
@@ -163,7 +163,7 @@ static int cix_ipbloq_hda_init(struct cix_ipbloq_hda *hda,
sname = of_get_property(pdev->dev.of_node, "model", NULL);
if (!sname)
sname = drv_name;
- if (strlen(sname) > sizeof(card->shortname))
+ if (strlen(sname) >= sizeof(card->shortname))
dev_dbg(card->dev, "truncating shortname for card\n");
strscpy(card->shortname, sname, sizeof(card->shortname));
--
2.55.0
next reply other threads:[~2026-12-02 13:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-02 13:22 Sreeraj S Kurup [this message]
2026-12-02 13:40 ` [PATCH v2] " Sreeraj S Kurup
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=20261202132227.2781-1-sreekuttan2156239@gmail.com \
--to=sreekuttan2156239@gmail.com \
--cc=cix-kernel-upstream@cixtech.com \
--cc=fugang.duan@cixtech.com \
--cc=gary.yang@cixtech.com \
--cc=linux-arm-kernel@lists.infradead.org \
--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®