eth: fbnic: Update fbnic_tlv_attr_get_string() to work like nla_strscpy()

Allow fbnic_tlv_attr_get_string() to return an error code. In the event the
source mailbox attribute is missing return -EINVAL. Like nla_strscpy() return
-E2BIG when the source string is larger than the destination string. In this
case the amount of data copied is equal to dstsize.

Signed-off-by: Lee Trager <lee@trager.us>
Link: https://patch.msgid.link/20250228191935.3953712-3-lee@trager.us
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Lee Trager 2025-02-28 11:15:27 -08:00 • committed by Jakub Kicinski
commit e5cf5107c9
2 changed files with 32 additions and 11 deletions