[PATCH] ALSA: hda: cix-ipbloq: Fix shortname truncation warning
From: Sreeraj S Kurup
Date: Wed Dec 02 2026 - 08:23:52 EST
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@xxxxxxxxx>
---
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