projects
/
platform
/
kernel
/
linux-rpi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8ecf595
)
target/usb-gadget: strlen() doesn't count the terminator
author
Dan Carpenter
<dan.carpenter@oracle.com>
Tue, 2 Oct 2012 08:27:14 +0000
(11:27 +0300)
committer
Nicholas Bellinger
<nab@linux-iscsi.org>
Tue, 2 Oct 2012 21:16:21 +0000
(14:16 -0700)
We need to take the terminator into consideration here or the last
character gets silently truncated away later.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/usb/gadget/tcm_usb_gadget.c
patch
|
blob
|
history
diff --git
a/drivers/usb/gadget/tcm_usb_gadget.c
b/drivers/usb/gadget/tcm_usb_gadget.c
index
0f75f23
..
5662d6e
100644
(file)
--- a/
drivers/usb/gadget/tcm_usb_gadget.c
+++ b/
drivers/usb/gadget/tcm_usb_gadget.c
@@
-1815,7
+1815,7
@@
static ssize_t tcm_usbg_tpg_store_nexus(
ret = tcm_usbg_drop_nexus(tpg);
return (!ret) ? count : ret;
}
- if (strlen(page) > USBG_NAMELEN) {
+ if (strlen(page) >
=
USBG_NAMELEN) {
pr_err("Emulated NAA Sas Address: %s, exceeds"
" max: %d\n", page, USBG_NAMELEN);
return -EINVAL;