diff options
Diffstat (limited to 'src/iphone.c')
| -rw-r--r-- | src/iphone.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/iphone.c b/src/iphone.c index 6eb56f7..5076b48 100644 --- a/src/iphone.c +++ b/src/iphone.c | |||
| @@ -95,7 +95,7 @@ static void iphone_config_usb_device(iphone_device_t phone) | |||
| 95 | * descriptor on return. | 95 | * descriptor on return. |
| 96 | * @return IPHONE_E_SUCCESS if ok, otherwise an error code. | 96 | * @return IPHONE_E_SUCCESS if ok, otherwise an error code. |
| 97 | */ | 97 | */ |
| 98 | static iphone_error_t iphone_get_specific_device(unsigned int bus_n, int dev_n, iphone_device_t * device) | 98 | iphone_error_t iphone_get_specific_device(unsigned int bus_n, int dev_n, iphone_device_t * device) |
| 99 | { | 99 | { |
| 100 | struct usb_bus *bus, *busses; | 100 | struct usb_bus *bus, *busses; |
| 101 | struct usb_device *dev; | 101 | struct usb_device *dev; |
| @@ -230,13 +230,15 @@ iphone_error_t iphone_free_device(iphone_device_t device) | |||
| 230 | unsigned char buf[512]; | 230 | unsigned char buf[512]; |
| 231 | 231 | ||
| 232 | // read final package(s) | 232 | // read final package(s) |
| 233 | do { | 233 | if (device->device != NULL) { |
| 234 | bytes = usb_bulk_read(device->device, BULKIN, (void *) &buf, 512, 800); | 234 | do { |
| 235 | if (bytes > 0) { | 235 | bytes = usb_bulk_read(device->device, BULKIN, (void *) &buf, 512, 800); |
| 236 | log_debug_msg("iphone_free_device: final read returned\n"); | 236 | if (bytes > 0) { |
| 237 | log_debug_buffer(buf, bytes); | 237 | log_debug_msg("iphone_free_device: final read returned\n"); |
| 238 | } | 238 | log_debug_buffer(buf, bytes); |
| 239 | } while (bytes > 0); | 239 | } |
| 240 | } while (bytes > 0); | ||
| 241 | } | ||
| 240 | 242 | ||
| 241 | if (device->buffer) { | 243 | if (device->buffer) { |
| 242 | free(device->buffer); | 244 | free(device->buffer); |
