summaryrefslogtreecommitdiff
path: root/liboctopus/octopus.c
diff options
context:
space:
mode:
authorroot <root@sheevaplug-debian.(none)>2011-02-25 20:13:51 +0000
committerroot <root@sheevaplug-debian.(none)>2011-02-25 20:13:51 +0000
commit35a36b0a6c69ce136fd6ea2a203d34e48e1291e8 (patch)
tree5142cacdf9a192b89d827c2e43e8350a6d63384a /liboctopus/octopus.c
parentdc36fedf56ecc011e34b4db59316e54cd3ccd121 (diff)
downloadmini-octopus-35a36b0a6c69ce136fd6ea2a203d34e48e1291e8.tar.gz
mini-octopus-35a36b0a6c69ce136fd6ea2a203d34e48e1291e8.zip
check dev->config
Diffstat (limited to 'liboctopus/octopus.c')
-rw-r--r--liboctopus/octopus.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/liboctopus/octopus.c b/liboctopus/octopus.c
index 9111b0d..641635b 100644
--- a/liboctopus/octopus.c
+++ b/liboctopus/octopus.c
@@ -162,6 +162,9 @@ int octopus_open_dev(struct octopus_context *octopus, struct usb_device *dev)
if (!(octopus->usb_handle = usb_open(dev)))
octopus_error_return(-3,"can't open usb device");
+ if (dev->config == NULL)
+ octopus_error_return(-7, "cant access configuration for given usb device");
+
if (usb_set_configuration (octopus->usb_handle,dev->config[0].bConfigurationValue) < 0)
octopus_error_return(-4,"can't set configuration for given usb device");