From ccec7a182f1373fb15051a1c03d28e44c4188cce Mon Sep 17 00:00:00 2001 From: Pali Rohár Date: Sun, 9 Jul 2017 14:57:41 +0200 Subject: disk: Close device file handle when freeing structures --- src/operations.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/operations.c') diff --git a/src/operations.c b/src/operations.c index cd7ef44..b3be2c7 100644 --- a/src/operations.c +++ b/src/operations.c @@ -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); } -- cgit v1.2.3