]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
caif: Replace memset(0) + strscpy() with strscpy_pad()
authorThorsten Blum <thorsten.blum@linux.dev>
Mon, 11 Aug 2025 09:34:40 +0000 (11:34 +0200)
committerJakub Kicinski <kuba@kernel.org>
Tue, 12 Aug 2025 21:08:56 +0000 (14:08 -0700)
commit63fe077c21d323cbc8d56114e9139bbadab33ce5
treeeb31a378f67034c87af964fa763113739b8d48ed
parente0ab61faba808bbb00728b2e33e09e534732e80f
caif: Replace memset(0) + strscpy() with strscpy_pad()

Replace memset(0) followed by strscpy() with strscpy_pad() to improve
cfctrl_linkup_request(). This avoids zeroing the memory before copying
the string and ensures the destination buffer is only written to once,
simplifying the code and improving efficiency.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Link: https://patch.msgid.link/20250811093442.5075-2-thorsten.blum@linux.dev
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/caif/cfctrl.c