From 35a36b0a6c69ce136fd6ea2a203d34e48e1291e8 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 25 Feb 2011 20:13:51 +0000 Subject: check dev->config --- liboctopus/octopus.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'liboctopus/octopus.c') 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"); -- cgit v1.2.1