acecad = kcalloc(1, sizeof(struct usb_acecad), GFP_KERNEL); 
acecad = kzalloc(sizeof(struct usb_acecad), GFP_KERNEL); 
static int usb_acecad_probe(struct usb_interface *intf, const struct usb_device_id *id){	struct usb_device *dev = interface_to_usbdev(intf);	struct usb_host_interface *interface = intf->cur_altsetting;	struct usb_endpoint_descriptor *endpoint;	struct usb_acecad *acecad;	int pipe, maxp;	char path[64];	if (interface->desc.bNumEndpoints != 1)		return -ENODEV;	endpoint = &interface->endpoint[0].desc;	if (!(endpoint->bEndpointAddress & 0x80))		return -ENODEV;	if ((endpoint->bmAttributes & 3) != 3)		return -ENODEV;	pipe = usb_rcvintpipe(dev, endpoint->bEndpointAddress);	maxp = usb_maxpacket(dev, pipe, usb_pipeout(pipe));	acecad = kcalloc(1, sizeof(struct usb_acecad), GFP_KERNEL);	if (!acecad)		return -ENOMEM;	acecad->data = usb_buffer_alloc(dev, 8, SLAB_KERNEL, &acecad->data_dma);	if (!acecad->data)		goto fail1;	acecad->irq = usb_alloc_urb(0, GFP_KERNEL);	if (!acecad->irq)		goto fail2;	if (dev->manufacturer)		strlcpy(acecad->name, dev->manufacturer, sizeof(acecad->name));	if (dev->product) {		if (dev->manufacturer)			strlcat(acecad->name, " ", sizeof(acecad->name));		strlcat(acecad->name, dev->product, sizeof(acecad->name));	}	usb_make_path(dev, path, sizeof(path));	snprintf(acecad->phys, sizeof(acecad->phys), "%s/input0", path);	acecad->usbdev = dev;	acecad->dev.evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);	acecad->dev.absbit[0] = BIT(ABS_X) | BIT(ABS_Y) | BIT(ABS_PRESSURE);	acecad->dev.keybit[LONG(BTN_LEFT)] = BIT(BTN_LEFT) | BIT(BTN_RIGHT) | BIT(BTN_MIDDLE);	acecad->dev.keybit[LONG(BTN_DIGI)] = BIT(BTN_TOOL_PEN) |BIT(BTN_TOUCH) | BIT(BTN_STYLUS) | BIT(BTN_STYLUS2);	switch (id->driver_info) {		case 0:			acecad->dev.absmax[ABS_X] = 5000;			acecad->dev.absmax[ABS_Y] = 3750;			acecad->dev.absmax[ABS_PRESSURE] = 512;			if (!strlen(acecad->name))				snprintf(acecad->name, sizeof(acecad->name),					"USB Acecad Flair Tablet %04x:%04x",					dev->descriptor.idVendor, dev->descriptor.idProduct);			break;		case 1:			acecad->dev.absmax[ABS_X] = 3000;			acecad->dev.absmax[ABS_Y] = 2250;			acecad->dev.absmax[ABS_PRESSURE] = 1024;			if (!strlen(acecad->name))				snprintf(acecad->name, sizeof(acecad->name),					"USB Acecad 302 Tablet %04x:%04x",					dev->descriptor.idVendor, dev->descriptor.idProduct);			break;	}	acecad->dev.absfuzz[ABS_X] = 4;	acecad->dev.absfuzz[ABS_Y] = 4;	acecad->dev.private = acecad;	acecad->dev.open = usb_acecad_open;	acecad->dev.close = usb_acecad_close;	acecad->dev.name = acecad->name;	acecad->dev.phys = acecad->phys;	usb_to_input_id(dev, &acecad->dev.id);	acecad->dev.dev = &intf->dev;	usb_fill_int_urb(acecad->irq, dev, pipe,			acecad->data, maxp > 8 ? 8 : maxp,			usb_acecad_irq, acecad, endpoint->bInterval);	acecad->irq->transfer_dma = acecad->data_dma;	acecad->irq->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;	input_register_device(&acecad->dev);	printk(KERN_INFO "input: %s with packet size %d on %s\n",		acecad->name, maxp, path);	usb_set_intfdata(intf, acecad);	return 0; fail2:	usb_buffer_free(dev, 8, acecad->data, acecad->data_dma); fail1:	kfree(acecad);	return -ENOMEM;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/7b842b6e3704f4b9606ff8a4ffe03579d9addf5e/acecad.c/buggy/drivers/usb/input/acecad.c