* [PATCH] ALSA: hda: cix-ipbloq: Fix shortname truncation warning
@ 2026-12-02 13:22 Sreeraj S Kurup
2026-12-02 13:40 ` [PATCH v2] " Sreeraj S Kurup
0 siblings, 1 reply; 3+ messages in thread
From: Sreeraj S Kurup @ 2026-12-02 13:22 UTC (permalink / raw)
To: cix-kernel-upstream, fugang.duan, gary.yang, perex, tiwai
Cc: linux-arm-kernel, linux-kernel, linux-sound, Sreeraj S Kurup
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH v2] ALSA: hda: cix-ipbloq: Fix shortname truncation warning
2026-12-02 13:22 [PATCH] ALSA: hda: cix-ipbloq: Fix shortname truncation warning Sreeraj S Kurup
@ 2026-12-02 13:40 ` Sreeraj S Kurup
2026-12-02 16:10 ` Takashi Iwai
0 siblings, 1 reply; 3+ messages in thread
From: Sreeraj S Kurup @ 2026-12-02 13:40 UTC (permalink / raw)
To: sreekuttan2156239, cix-kernel-upstream, fugang.duan, gary.yang,
perex, tiwai
Cc: linux-arm-kernel, linux-kernel, linux-sound
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@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
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH v2] ALSA: hda: cix-ipbloq: Fix shortname truncation warning
2026-12-02 13:40 ` [PATCH v2] " Sreeraj S Kurup
@ 2026-12-02 16:10 ` Takashi Iwai
0 siblings, 0 replies; 3+ messages in thread
From: Takashi Iwai @ 2026-12-02 16:10 UTC (permalink / raw)
To: Sreeraj S Kurup
Cc: cix-kernel-upstream, fugang.duan, gary.yang, perex, tiwai,
linux-arm-kernel, linux-kernel, linux-sound
On Wed, 02 Dec 2026 14:40:28 +0100,
Sreeraj S Kurup wrote:
>
> 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@gmail.com>
Applied to for-next branch. Thanks.
Takashi
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-12-02 16:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-12-02 13:22 [PATCH] ALSA: hda: cix-ipbloq: Fix shortname truncation warning Sreeraj S Kurup
2026-12-02 13:40 ` [PATCH v2] " Sreeraj S Kurup
2026-12-02 16:10 ` Takashi Iwai
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®