kfree(p_dev->devname); 
struct pcmcia_device * pcmcia_device_add(struct pcmcia_socket *s, unsigned int function){	struct pcmcia_device *p_dev;	unsigned long flags;	s = pcmcia_get_socket(s);	if (!s)		return NULL;	down(&device_add_lock);	/* max of 2 devices per card */	if (s->device_count == 2)		goto err_put;	p_dev = kmalloc(sizeof(struct pcmcia_device), GFP_KERNEL);	if (!p_dev)		goto err_put;	memset(p_dev, 0, sizeof(struct pcmcia_device));	p_dev->socket = s;	p_dev->device_no = (s->device_count++);	p_dev->func   = function;	p_dev->dev.bus = &pcmcia_bus_type;	p_dev->dev.parent = s->dev.dev;	p_dev->dev.release = pcmcia_release_dev;	sprintf (p_dev->dev.bus_id, "%d.%d", p_dev->socket->sock, p_dev->device_no);	/* compat */	p_dev->state = CLIENT_UNBOUND;	/* Add to the list in pcmcia_bus_socket */	spin_lock_irqsave(&pcmcia_dev_list_lock, flags);	list_add_tail(&p_dev->socket_device_list, &s->devices_list);	spin_unlock_irqrestore(&pcmcia_dev_list_lock, flags);	pcmcia_device_query(p_dev);	if (device_register(&p_dev->dev)) {		spin_lock_irqsave(&pcmcia_dev_list_lock, flags);		list_del(&p_dev->socket_device_list);		spin_unlock_irqrestore(&pcmcia_dev_list_lock, flags);		goto err_free;       }	up(&device_add_lock);	return p_dev; err_free:	kfree(p_dev);	s->device_count--; err_put:	up(&device_add_lock);	pcmcia_put_socket(s);	return NULL;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/bd65a68574b787304a0cd90f22cfd44540ce3695/ds.c/buggy/drivers/pcmcia/ds.c