diff options
author | Justin Stitt <justinstitt@google.com> | 2023-10-11 21:37:18 +0000 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2023-10-13 17:10:32 -0700 |
commit | e343023e03d2bdadf6551298863c09b4cba5963d (patch) | |
tree | e9a843b5668aa273509baa7caa0c2fae44d7dc50 /drivers/net/ethernet/brocade | |
parent | 88fca39b660b97651fbf5ba18074b7999fab98a7 (diff) |
net: sparx5: replace deprecated strncpy with ethtool_sprintf
strncpy() is deprecated for use on NUL-terminated destination strings
[1] and as such we should prefer more robust and less ambiguous string
interfaces.
ethtool_sprintf() is designed specifically for get_strings() usage.
Let's replace strncpy() in favor of this more robust and easier to
understand interface.
Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1]
Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2]
Link: https://github.com/KSPP/linux/issues/90
Signed-off-by: Justin Stitt <justinstitt@google.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20231011-strncpy-drivers-net-ethernet-microchip-sparx5-sparx5_ethtool-c-v1-1-410953d07f42@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/ethernet/brocade')
0 files changed, 0 insertions, 0 deletions