summaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/configfs.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-07 13:15:13 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-07 13:15:13 +0000
commit246dcf5ef201b8e7735b0894e18189c712374a0f (patch)
tree7b48ee473954dea09d91a84bb5bbf5b26c67b201 /drivers/usb/gadget/configfs.c
parentAdding debian version 6.9.9-1. (diff)
downloadlinux-246dcf5ef201b8e7735b0894e18189c712374a0f.tar.xz
linux-246dcf5ef201b8e7735b0894e18189c712374a0f.zip
Merging upstream version 6.9.10.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'drivers/usb/gadget/configfs.c')
-rw-r--r--drivers/usb/gadget/configfs.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/usb/gadget/configfs.c b/drivers/usb/gadget/configfs.c
index ce3cfa1f36..0e7c1e947c 100644
--- a/drivers/usb/gadget/configfs.c
+++ b/drivers/usb/gadget/configfs.c
@@ -115,9 +115,12 @@ static int usb_string_copy(const char *s, char **s_copy)
int ret;
char *str;
char *copy = *s_copy;
+
ret = strlen(s);
if (ret > USB_MAX_STRING_LEN)
return -EOVERFLOW;
+ if (ret < 1)
+ return -EINVAL;
if (copy) {
str = copy;