summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThorsten Blum <blum@kernel.org>2026-10-21 12:39:29 +0200
committerTakashi Iwai <tiwai@suse.de>2026-10-21 14:58:16 +0200
commit8045043c9d66508b5ebfd702e555b9642b5aa805 (patch)
tree27fe202c4d9628fe662cd5f3691cc50d9c43d4c3
parent87bc966dc59ff43694f201a39983963a66be6102 (diff)
ALSA: caiaq: Use strscpy() in snd_usb_caiaq_input_init()
To prepare for removing strlcat() from the kernel [1], use strscpy() instead with the length returned by usb_make_path() as the append offset. No functional change. Link: https://github.com/KSPP/linux/issues/370 [1] Signed-off-by: Thorsten Blum <blum@kernel.org> Link: https://patch.msgid.link/20261021103928.131918-2-blum@kernel.org Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/usb/caiaq/input.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sound/usb/caiaq/input.c b/sound/usb/caiaq/input.c
index 856235c3398e..2830a1da067d 100644
--- a/sound/usb/caiaq/input.c
+++ b/sound/usb/caiaq/input.c
@@ -620,13 +620,15 @@ int snd_usb_caiaq_input_init(struct snd_usb_caiaqdev *cdev)
struct usb_device *usb_dev = cdev->chip.dev;
struct input_dev *input;
int i, ret = 0;
+ int len;
input = input_allocate_device();
if (!input)
return -ENOMEM;
- usb_make_path(usb_dev, cdev->phys, sizeof(cdev->phys));
- strlcat(cdev->phys, "/input0", sizeof(cdev->phys));
+ len = usb_make_path(usb_dev, cdev->phys, sizeof(cdev->phys));
+ if (len >= 0)
+ strscpy(cdev->phys + len, "/input0", sizeof(cdev->phys) - len);
input->name = cdev->product_name;
input->phys = cdev->phys;