kfree (tmp); 
kfree(tmp); 
parport_register_device(struct parport *port, const char *name,			int (*pf)(void *), void (*kf)(void *),			void (*irq_func)(int, void *, struct pt_regs *), 			int flags, void *handle){	struct pardevice *tmp;	if (port->physport->flags & PARPORT_FLAG_EXCL) {		/* An exclusive device is registered. */		printk (KERN_DEBUG "%s: no more devices allowed\n",			port->name);		return NULL;	}	if (flags & PARPORT_DEV_LURK) {		if (!pf || !kf) {			printk(KERN_INFO "%s: refused to register lurking device (%s) without callbacks\n", port->name, name);			return NULL;		}	}	/* We up our own module reference count, and that of the port           on which a device is to be registered, to ensure that           neither of us gets unloaded while we sleep in (e.g.)           kmalloc.         */	if (!try_module_get(port->ops->owner)) {		return NULL;	}			parport_get_port (port);	tmp = kmalloc(sizeof(struct pardevice), GFP_KERNEL);	if (tmp == NULL) {		printk(KERN_WARNING "%s: memory squeeze, couldn't register %s.\n", port->name, name);		goto out;	}	tmp->state = kmalloc(sizeof(struct parport_state), GFP_KERNEL);	if (tmp->state == NULL) {		printk(KERN_WARNING "%s: memory squeeze, couldn't register %s.\n", port->name, name);		goto out_free_pardevice;	}	tmp->name = name;	tmp->port = port;	tmp->daisy = -1;	tmp->preempt = pf;	tmp->wakeup = kf;	tmp->private = handle;	tmp->flags = flags;	tmp->irq_func = irq_func;	tmp->waiting = 0;	tmp->timeout = 5 * HZ;	/* Chain this onto the list */	tmp->prev = NULL;	/*	 * This function must not run from an irq handler so we don' t need	 * to clear irq on the local CPU. -arca	 */	spin_lock(&port->physport->pardevice_lock);	if (flags & PARPORT_DEV_EXCL) {		if (port->physport->devices) {			spin_unlock (&port->physport->pardevice_lock);			printk (KERN_DEBUG				"%s: cannot grant exclusive access for "				"device %s\n", port->name, name);			goto out_free_all;		}		port->flags |= PARPORT_FLAG_EXCL;	}	tmp->next = port->physport->devices;	wmb(); /* Make sure that tmp->next is written before it's                  added to the list; see comments marked 'no locking                  required' */	if (port->physport->devices)		port->physport->devices->prev = tmp;	port->physport->devices = tmp;	spin_unlock(&port->physport->pardevice_lock);	init_waitqueue_head(&tmp->wait_q);	tmp->timeslice = parport_default_timeslice;	tmp->waitnext = tmp->waitprev = NULL;	/*	 * This has to be run as last thing since init_state may need other	 * pardevice fields. -arca	 */	port->ops->init_state(tmp, tmp->state);	parport_device_proc_register(tmp);	return tmp; out_free_all:	kfree (tmp->state); out_free_pardevice:	kfree (tmp); out:	parport_put_port (port);	module_put(port->ops->owner);	return NULL;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/6044ec8882c726e325017bd948aa0cd94ad33abc/share.c/clean/drivers/parport/share.c