projects
/
sdk
/
tools
/
sdb.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b6a5984
)
SDB: Checked the length of reading device description
44/18844/2
author
shingil.kang
<shingil.kang@samsung.com>
Wed, 2 Apr 2014 02:52:07 +0000
(11:52 +0900)
committer
shingil.kang
<shingil.kang@samsung.com>
Wed, 2 Apr 2014 06:54:49 +0000
(15:54 +0900)
Change-Id: I7a65070ce946d26c46194406695d387f2eda023a
Signed-off-by: shingil.kang <shingil.kang@samsung.com>
src/usb_linux.c
patch
|
blob
|
history
diff --git
a/src/usb_linux.c
b/src/usb_linux.c
index fcba4e85d47fdc96dc6391ce1fcfa408ea214a3d..e2a9d7200382141b94f43063654501fe2069a858 100644
(file)
--- a/
src/usb_linux.c
+++ b/
src/usb_linux.c
@@
-64,11
+64,13
@@
int register_device(const char* node, const char* serial) {
return -1;
}
- if (read(fd, device_desc, sizeof(device_desc)) < 0) {
+ int length;
+ if ((length = read(fd, device_desc, sizeof(device_desc))) < 0) {
LOG_DEBUG("failed to read usb node %s (%s)\n", node, strerror(errno));
close(fd);
return -1;
}
+
desc_current_ptr = device_desc;
// get device descriptor from head first