disk: Close device file handle when freeing structures

This commit is contained in:
Pali Rohár committed 2017-07-09 14:57:41 +02:00
1 parent 31569c169a
commit ccec7a182f
3 files changed
+12 -1

No files matched your search

+4 -1
View File
@@ -91,8 +91,11 @@ clean:
void dev_free(struct device_info * dev) {
if ( dev->usb )
if ( dev->usb ) {
if ( dev->usb->flash_device->protocol == FLASH_DISK )
disk_exit(dev->usb);
usb_close_device(dev->usb);
}
free(dev);
}