LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Aibing Chen <chenaibing@cmss.chinamobile.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: Johannes Berg <johannes@sipsolutions.net>,
	Jaroslav Kysela <perex@perex.cz>,
	linuxppc-dev@lists.ozlabs.org, linux-sound@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ALSA: aoa: size the codec reference property name buffer
Date: Mon, 23 Nov 2026 11:27:58 +0800	[thread overview]
Message-ID: <20261123032758.855-1-chenaibing@cmss.chinamobile.com> (raw)
In-Reply-To: <87cxs5ypv9.wl-tiwai@suse.de>

Hi Takashi,

You are right, there is no truncation with the codecs that exist in the
tree.  codec->name is only ever set from a fixed string:

  sound/aoa/codecs/onyx.c:1005     strscpy(onyx->codec.name, "onyx");
  sound/aoa/codecs/tas.c:860       strscpy(tas->codec.name, "tas");
  sound/aoa/codecs/toonie.c:129    strscpy(toonie->codec.name, "toonie");

so the longest property name built by check_codec() is
"platform-toonie-codec-ref", 25 bytes including the terminator, which
fits in the existing 32 byte array.  The W=1 warning is a false positive:
the compiler cannot bound the length of codec->name.

I will drop the patch.

Thanks,
Aibing Chen




      reply	other threads:[~2026-11-23  3:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-13 10:30 [PATCH] ALSA: aoa: size the codec reference property name buffer Aibing Chen
2026-11-16 11:31 ` Takashi Iwai
2026-11-23  3:27   ` Aibing Chen [this message]

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=20261123032758.855-1-chenaibing@cmss.chinamobile.com \
    --to=chenaibing@cmss.chinamobile.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.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