]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
crypto: octeontx - use strscpy_pad in ucode_load_store
authorThorsten Blum <thorsten.blum@linux.dev>
Wed, 20 May 2026 10:00:30 +0000 (12:00 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 29 May 2026 06:05:29 +0000 (14:05 +0800)
commita43b47340b6bf809f282db8639fc4deea0180208
treebe967bca2beccd5717e769f8d1005309ba23bca0
parent59f61b242400939084fe644e4e0cb7f141279ad7
crypto: octeontx - use strscpy_pad in ucode_load_store

Instead of zero-initializing the temporary buffer and then copying into
it with strscpy(), use strscpy_pad() to copy the string and zero-pad any
trailing bytes. Drop the explicit size argument to further simplify the
code since strscpy_pad() can determine it automatically when the
destination buffer has a fixed length.

Also use strscpy_pad() to check for string truncation instead of the
hard-coded OTX_CPT_UCODE_NAME_LENGTH.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/marvell/octeontx/otx_cptpf_ucode.c