Linux Sound subsystem development
 help / color / mirror / Atom feed
From: <shumingf@realtek.com>
To: <broonie@kernel.org>, <lgirdwood@gmail.com>
Cc: <linux-sound@vger.kernel.org>, <lars@metafoo.de>,
	<flove@realtek.com>, <oder_chiou@realtek.com>,
	<jack.yu@realtek.com>, <derek.fang@realtek.com>,
	Shuming Fan <shumingf@realtek.com>,
	kernel test robot <lkp@intel.com>
Subject: [PATCH] ASoC: rt1320: fix the warning the string may be truncated
Date: Mon, 22 Dec 2025 18:13:29 +0800	[thread overview]
Message-ID: <20251222101329.558973-1-shumingf@realtek.com> (raw)

From: Shuming Fan <shumingf@realtek.com>

1488 |                          "realtek/rt1320/rt1320_%s_%s_%s.dat", vendor, product, sku);
     |                                                 ^~             ~~~~~~
sound/soc/codecs/rt1320-sdw.c:1487:17: note: 'snprintf' output between 29 and 410 bytes into a destination of size 128
1487 |                 snprintf(filename, sizeof(filename),
     |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1488 |                          "realtek/rt1320/rt1320_%s_%s_%s.dat", vendor, product, sku);
     |

Fixes: da1682d5e8b5 ("ASoC: rt1320: support calibration and temperature/r0 loading")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202512191521.RK0edKdX-lkp@intel.com/
Signed-off-by: Shuming Fan <shumingf@realtek.com>
---
 sound/soc/codecs/rt1320-sdw.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/codecs/rt1320-sdw.c b/sound/soc/codecs/rt1320-sdw.c
index 9447e742c672..4c3756940ae2 100644
--- a/sound/soc/codecs/rt1320-sdw.c
+++ b/sound/soc/codecs/rt1320-sdw.c
@@ -1435,7 +1435,7 @@ static int rt1320_rae_load(struct rt1320_sdw_priv *rt1320)
 	const char *dmi_vendor, *dmi_product, *dmi_sku;
 	char vendor[128], product[128], sku[128];
 	char *ptr_vendor, *ptr_product, *ptr_sku;
-	char rae_filename[128];
+	char rae_filename[512];
 	char tag[5];
 	int ret = 0;
 	int retry = 200;
@@ -1602,7 +1602,7 @@ struct rt1320_dspfwheader {
 	const char *dmi_vendor, *dmi_product, *dmi_sku;
 	char vendor[128], product[128], sku[128];
 	char *ptr_vendor, *ptr_product, *ptr_sku;
-	char filename[128];
+	char filename[512];
 
 	switch (rt1320->dev_id) {
 	case RT1320_DEV_ID:
-- 
2.52.0


             reply	other threads:[~2025-12-22 10:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-22 10:13 shumingf [this message]
2025-12-22 19:40 ` [PATCH] ASoC: rt1320: fix the warning the string may be truncated Mark Brown

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=20251222101329.558973-1-shumingf@realtek.com \
    --to=shumingf@realtek.com \
    --cc=broonie@kernel.org \
    --cc=derek.fang@realtek.com \
    --cc=flove@realtek.com \
    --cc=jack.yu@realtek.com \
    --cc=lars@metafoo.de \
    --cc=lgirdwood@gmail.com \
    --cc=linux-sound@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=oder_chiou@realtek.com \
    /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