diff options
author | shingil.kang <shingil.kang@samsung.com> | 2014-04-02 11:52:07 +0900 |
---|---|---|
committer | shingil.kang <shingil.kang@samsung.com> | 2014-04-02 15:54:49 +0900 |
commit | fe5f8099903a86cf4c154ef3638a57848037a578 (patch) | |
tree | 71a02bb4ba012978ae2829bc59fbfd3f55bf5bc9 | |
parent | b6a5984084230f32b28b9fc81ae8938362b4a00c (diff) | |
download | sdb-fe5f8099903a86cf4c154ef3638a57848037a578.tar.gz sdb-fe5f8099903a86cf4c154ef3638a57848037a578.tar.bz2 sdb-fe5f8099903a86cf4c154ef3638a57848037a578.zip |
SDB: Checked the length of reading device description
Change-Id: I7a65070ce946d26c46194406695d387f2eda023a
Signed-off-by: shingil.kang <shingil.kang@samsung.com>
-rw-r--r-- | src/usb_linux.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/usb_linux.c b/src/usb_linux.c index fcba4e8..e2a9d72 100644 --- 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 |