ASoC: codecs: Call strscpy() with correct size argument
authorThorsten Blum <thorsten.blum@linux.dev>
Sun, 10 Aug 2025 21:41:05 +0000 (23:41 +0200)
committerMark Brown <broonie@kernel.org>
Tue, 12 Aug 2025 11:05:56 +0000 (12:05 +0100)
commitdcb82900b12f5809e66835918d4043284ce1d39c
tree013befaf7bb7c4de42e9e4982d9e97a0009151af
parentb11f2a9745401d9ccc51c91b5482044d2ea936e8
ASoC: codecs: Call strscpy() with correct size argument

In aw8xxxx_profile_info(), strscpy() is called with the length of the
source string "null" rather than the size of the destination buffer.

This is fine as long as the destination buffer is larger than the source
string, but we should still use the destination buffer size instead to
call strscpy() as intended. And since 'name' points to the fixed-size
buffer 'uinfo->value.enumerated.name', we can safely omit the size
argument and let strscpy() infer it using sizeof() and remove 'name'.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Link: https://patch.msgid.link/20250810214144.1985-2-thorsten.blum@linux.dev
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/aw87390.c
sound/soc/codecs/aw88081.c
sound/soc/codecs/aw88166.c
sound/soc/codecs/aw88261.c
sound/soc/codecs/aw88395/aw88395.c
sound/soc/codecs/aw88399.c