(endpoint->bEndpointAddress & USB_DIR_IN) && 
((endpoint->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN) && 
static int skel_probe(struct usb_interface *interface, const struct usb_device_id *id){	struct usb_skel *dev = NULL;	struct usb_host_interface *iface_desc;	struct usb_endpoint_descriptor *endpoint;	size_t buffer_size;	int i;	int retval = -ENOMEM;	/* allocate memory for our device state and initialize it */	dev = kmalloc(sizeof(*dev), GFP_KERNEL);	if (dev == NULL) {		err("Out of memory");		goto error;	}	memset(dev, 0x00, sizeof(*dev));	kref_init(&dev->kref);	dev->udev = usb_get_dev(interface_to_usbdev(interface));	dev->interface = interface;	/* set up the endpoint information */	/* use only the first bulk-in and bulk-out endpoints */	iface_desc = interface->cur_altsetting;	for (i = 0; i < iface_desc->desc.bNumEndpoints; ++i) {		endpoint = &iface_desc->endpoint[i].desc;		if (!dev->bulk_in_endpointAddr &&		    (endpoint->bEndpointAddress & USB_DIR_IN) &&		    ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK)					== USB_ENDPOINT_XFER_BULK)) {			/* we found a bulk in endpoint */			buffer_size = le16_to_cpu(endpoint->wMaxPacketSize);			dev->bulk_in_size = buffer_size;			dev->bulk_in_endpointAddr = endpoint->bEndpointAddress;			dev->bulk_in_buffer = kmalloc(buffer_size, GFP_KERNEL);			if (!dev->bulk_in_buffer) {				err("Could not allocate bulk_in_buffer");				goto error;			}		}		if (!dev->bulk_out_endpointAddr &&		    !(endpoint->bEndpointAddress & USB_DIR_OUT) &&		    ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK)					== USB_ENDPOINT_XFER_BULK)) {			/* we found a bulk out endpoint */			dev->bulk_out_endpointAddr = endpoint->bEndpointAddress;		}	}	if (!(dev->bulk_in_endpointAddr && dev->bulk_out_endpointAddr)) {		err("Could not find both bulk-in and bulk-out endpoints");		goto error;	}	/* save our data pointer in this interface device */	usb_set_intfdata(interface, dev);	/* we can register the device now, as it is ready */	retval = usb_register_dev(interface, &skel_class);	if (retval) {		/* something prevented us from registering this driver */		err("Not able to get a minor for this device.");		usb_set_intfdata(interface, NULL);		goto error;	}	/* let the user know what node this device is now attached to */	info("USB Skeleton device now attached to USBSkel-%d", interface->minor);	return 0;error:	if (dev)		kref_put(&dev->kref, skel_delete);	return retval;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/6b216df87cb5f3bb7d47a33f1cd955ebc7b84dfd/usb-skeleton.c/buggy/drivers/usb/usb-skeleton.c