kmalloc(IMGSIZE + buffer_size, GFP_KERNEL); 
kmalloc(IMGSIZE + dev->bulk_in_size, GFP_KERNEL); 
static int idmouse_probe(struct usb_interface *interface,				const struct usb_device_id *id){	struct usb_device *udev = interface_to_usbdev(interface);	struct usb_idmouse *dev = NULL;	struct usb_host_interface *iface_desc;	struct usb_endpoint_descriptor *endpoint;	size_t buffer_size;	int result;	/* check if we have gotten the data or the hid interface */	iface_desc = &interface->altsetting[0];	if (iface_desc->desc.bInterfaceClass != 0x0A)		return -ENODEV;	/* allocate memory for our device state and initialize it */	dev = kmalloc(sizeof(*dev), GFP_KERNEL);	if (dev == NULL)		return -ENOMEM;	memset(dev, 0x00, sizeof(*dev));	init_MUTEX(&dev->sem);	dev->udev = udev;	dev->interface = interface;	/* set up the endpoint information - use only the first bulk-in endpoint */	endpoint = &iface_desc->endpoint[0].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(IMGSIZE + buffer_size, GFP_KERNEL);		if (!dev->bulk_in_buffer) {			err("Unable to allocate input buffer.");			idmouse_delete(dev);			return -ENOMEM;		}	}	if (!(dev->bulk_in_endpointAddr)) {		err("Unable to find bulk-in endpoint.");		idmouse_delete(dev);		return -ENODEV;	}	/* allow device read, write and ioctl */	dev->present = 1;	/* we can register the device now, as it is ready */	usb_set_intfdata(interface, dev);	result = usb_register_dev(interface, &idmouse_class);	if (result) {		/* something prevented us from registering this device */		err("Unble to allocate minor number.");		usb_set_intfdata(interface, NULL);		idmouse_delete(dev);		return result;	}	/* be noisy */	dev_info(&interface->dev,"%s now attached\n",DRIVER_DESC);	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/4244f72436ab77c3c29a6447af81734ab3925d85/idmouse.c/buggy/drivers/usb/misc/idmouse.c