Commit 3d0dc53
usb: gadget: uvc: fix changing interface name via configfs
When setting the function name, it is always truncated by one char since
snprintf is always including the null-termination in the len parameter.
We use strscpy and fix the size setting to use len + 1 instead.
Fixes: 324e4f8 ("usb: gadget: uvc: allow changing interface name via configfs")
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Link: https://lore.kernel.org/r/20220707115612.2760569-1-m.grzeschik@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent 6fb9e1d commit 3d0dc53
1 file changed
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2371 | 2371 | | |
2372 | 2372 | | |
2373 | 2373 | | |
| 2374 | + | |
2374 | 2375 | | |
2375 | 2376 | | |
2376 | 2377 | | |
| |||
2379 | 2380 | | |
2380 | 2381 | | |
2381 | 2382 | | |
2382 | | - | |
2383 | | - | |
| 2383 | + | |
| 2384 | + | |
| 2385 | + | |
2384 | 2386 | | |
2385 | 2387 | | |
2386 | 2388 | | |
| |||
0 commit comments