Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

usb: gadget: udc: Use safer strscpy() instead of strcpy()

Use a safer function strscpy() instead of strcpy() for copying to
arrays.

Only idiomatic code replacement, and no functional changes.

Signed-off-by: Ai Chao <aichao@kylinos.cn>
Link: https://patch.msgid.link/20260310094434.3639602-6-aichao@kylinos.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Ai Chao and committed by
Greg Kroah-Hartman
9b4051a4 2131540d

+1 -1
+1 -1
drivers/usb/gadget/udc/snps_udc_core.c
··· 3151 3151 tmp, dev->phys_addr, dev->chiprev, 3152 3152 (dev->chiprev == UDC_HSA0_REV) ? 3153 3153 "A0" : "B1"); 3154 - strcpy(tmp, UDC_DRIVER_VERSION_STRING); 3154 + strscpy(tmp, UDC_DRIVER_VERSION_STRING); 3155 3155 if (dev->chiprev == UDC_HSA0_REV) { 3156 3156 dev_err(dev->dev, "chip revision is A0; too old\n"); 3157 3157 retval = -ENODEV;