net: ena: Changes around strscpy calls
authorDavid Arinzon <darinzon@amazon.com>
Sun, 12 May 2024 13:46:36 +0000 (13:46 +0000)
committerJakub Kicinski <kuba@kernel.org>
Mon, 13 May 2024 21:42:04 +0000 (14:42 -0700)
commit97776caf6c6e3a932d8e1410e6810cbfcb69d42d
treeb116b5c867d4b3e58f76318d99a62a72f366f72b
parentb37b98a3a0c1198bafe8c2d9ce0bc845b4e7a9a7
net: ena: Changes around strscpy calls

strscpy copies as much of the string as possible,
meaning that the destination string will be truncated
in case of no space. As this is a non-critical error in
our case, adding a debug level print for indication.

This patch also removes a -1 which was added to ensure
enough space for NUL, but strscpy destination string is
guaranteed to be NUL-terminted, therefore, the -1 is
not needed.

Signed-off-by: David Arinzon <darinzon@amazon.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://lore.kernel.org/r/20240512134637.25299-5-darinzon@amazon.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/amazon/ena/ena_ethtool.c
drivers/net/ethernet/amazon/ena/ena_netdev.c