operations: Fix crash when no usb device is detected
This commit is contained in:
1 parent
55bfee79a2
commit
de32a6140a
1 file changed
+2
-1
+2
-1
@@ -80,7 +80,8 @@ struct device_info * dev_detect(void) {
|
||||
}
|
||||
|
||||
clean:
|
||||
usb_close_device(usb);
|
||||
if (usb)
|
||||
usb_close_device(usb);
|
||||
free(dev);
|
||||
return NULL;
|
||||
|
||||
|
||||
Reference in new issue
Block a user