staging: greybus: Check for string truncation instead of NUL-termination
authorThorsten Blum <thorsten.blum@linux.dev>
Wed, 2 Apr 2025 11:57:54 +0000 (13:57 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 15 Apr 2025 14:26:46 +0000 (16:26 +0200)
commitc511db3f1de6be1690ccbc53e0bb786073eda74a
tree95c74cae4bfe4fa77270eda1e8f4b70f910ff9b3
parentd486f2e07836fd8435c2ec0512b5d81cfc00781c
staging: greybus: Check for string truncation instead of NUL-termination

Commit 18f44de63f88 ("staging: greybus: change strncpy() to
strscpy_pad()") didn't remove the now unnecessary NUL-termination
checks. Unlike strncpy(), strscpy_pad() guarantees that the destination
buffer is NUL-terminated, making these checks obsolete. Remove them and
check for string truncation instead.

Compile-tested only.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Link: https://lore.kernel.org/r/20250402115755.1929043-1-thorsten.blum@linux.dev
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/greybus/fw-management.c