[PATCH v2] ALSA: hda: cix-ipbloq: Fix shortname truncation warning

Sreeraj S Kurup sreekuttan2156239 at gmail.com
Wed Dec 2 05:40:28 PST 2026


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.

Fixes: d91e9bd10125 ("ALSA: hda: add CIX IPBLOQ HDA controller support")
Signed-off-by: Sreeraj S Kurup <sreekuttan2156239 at gmail.com>
---
v2:
 - Add Fixes trailer.

 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




More information about the linux-arm-kernel mailing list