diff options
Diffstat (limited to 'libgphoto2_port/libusb1')
-rw-r--r-- | libgphoto2_port/libusb1/libusb1.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libgphoto2_port/libusb1/libusb1.c b/libgphoto2_port/libusb1/libusb1.c index 2faf3076d..94094977b 100644 --- a/libgphoto2_port/libusb1/libusb1.c +++ b/libgphoto2_port/libusb1/libusb1.c @@ -434,7 +434,10 @@ gp_libusb1_open (GPPort *port) static int gp_libusb1_close (GPPort *port) { - C_PARAMS (port && port->pl->dh); + C_PARAMS (port); + + if (port->pl->dh == NULL) + return GP_OK; if (libusb_release_interface (port->pl->dh, port->settings.usb.interface) < 0) { |