mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/
synced 2026-11-10 20:48:12 +00:00
crypto: qat - use strscpy_pad to simplify adf_service_string_to_mask
Use strscpy_pad() to copy buf and zero-pad any trailing bytes instead of zero-initializing the local services buffer and then using strscpy() to copy into it. Also use the strscpy_pad() return value to detect string truncation instead of checking the caller-provided length. Remove the now-unused length parameters from adf_service_string_to_mask() and adf_parse_service_string(). Also remove the redundant strnlen() call in adf_get_service_mask(), which only computed the removed length argument. Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
b73b71df4c
commit
34fd0e7c90
3 changed files with 8 additions and 11 deletions
Loading…
Add table
Add a link
Reference in a new issue