]> sigrok.org Git - libsigrok.git/commitdiff
genericdmm/victor-70c: warn if detaching kernel driver fails
authorBert Vermeulen <redacted>
Sun, 2 Sep 2012 13:13:00 +0000 (15:13 +0200)
committerBert Vermeulen <redacted>
Sun, 2 Sep 2012 13:42:56 +0000 (15:42 +0200)
hardware/genericdmm/victor-70c.c

index 169f48acf9718ee8cb5021fc2c295c58de15c91d..435008ffd718b0ecd9436a41d50674d3e03d3bdb 100644 (file)
@@ -270,8 +270,12 @@ static int victor70c_data(struct sr_dev_inst *sdi)
 
        if (sdi->status == SR_ST_INACTIVE) {
                /* First time through. */
-               if (libusb_kernel_driver_active(devc->usb->devhdl, 0) == 1)
-                       libusb_detach_kernel_driver(devc->usb->devhdl, 0);
+               if (libusb_kernel_driver_active(devc->usb->devhdl, 0) == 1) {
+                       if (libusb_detach_kernel_driver(devc->usb->devhdl, 0) < 0) {
+                               sr_err("genericdmm/victor-70c: failed to detach kernel driver");
+                               return SR_ERR;
+                       }
+               }
 
                if (libusb_claim_interface(devc->usb->devhdl, 0)) {
                        sr_err("genericdmm/victor-70c: failed to claim interface 0");