]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
Bluetooth: btintel_pcie: Use strscpy() instead of strscpy_pad()
authorThorsten Blum <thorsten.blum@linux.dev>
Mon, 11 Aug 2025 09:19:06 +0000 (11:19 +0200)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Sat, 27 Sep 2025 15:37:00 +0000 (11:37 -0400)
commit5967c08545e9d591e06c205b74fd25f8a702029c
treed64f5bf5115958bf2f9f8aa5e52783168760bee3
parentd4e99db3d942c8099006f3b7536bc52f766b475a
Bluetooth: btintel_pcie: Use strscpy() instead of strscpy_pad()

kzalloc() already zero-initializes the destination buffer 'data', making
strscpy() sufficient for safely copying 'name'. The additional
NUL-padding performed by strscpy_pad() is unnecessary.

Add a new local variable to store the length of 'name' and reuse it
instead of recalculating the same length.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
drivers/bluetooth/btintel_pcie.c