write_lock_irqsave(&intf->users_lock, flags); list_add_tail(&new_user->link, &intf->users); write_unlock_irqrestore(&intf->users_lock, flags); 
new_user->valid = 1; spin_lock_irqsave(&intf->seq_lock, flags); list_add_rcu(&new_user->link, &intf->users); spin_unlock_irqrestore(&intf->seq_lock, flags); *user = new_user; return 0; 
int ipmi_create_user(unsigned int          if_num,		     struct ipmi_user_hndl *handler,		     void                  *handler_data,		     ipmi_user_t           *user){	unsigned long flags;	ipmi_user_t   new_user;	int           rv = 0;	ipmi_smi_t    intf;	/* There is no module usecount here, because it's not           required.  Since this can only be used by and called from           other modules, they will implicitly use this module, and           thus this can't be removed unless the other modules are           removed. */	if (handler == NULL)		return -EINVAL;	/* Make sure the driver is actually initialized, this handles	   problems with initialization order. */	if (!initialized) {		rv = ipmi_init_msghandler();		if (rv)			return rv;		/* The init code doesn't return an error if it was turned		   off, but it won't initialize.  Check that. */		if (!initialized)			return -ENODEV;	}	new_user = kmalloc(sizeof(*new_user), GFP_KERNEL);	if (! new_user)		return -ENOMEM;	down_read(&interfaces_sem);	if ((if_num >= MAX_IPMI_INTERFACES) || ipmi_interfaces[if_num] == NULL)	{		rv = -EINVAL;		goto out_unlock;	}	intf = ipmi_interfaces[if_num];	new_user->handler = handler;	new_user->handler_data = handler_data;	new_user->intf = intf;	new_user->gets_events = 0;	if (!try_module_get(intf->handlers->owner)) {		rv = -ENODEV;		goto out_unlock;	}	if (intf->handlers->inc_usecount) {		rv = intf->handlers->inc_usecount(intf->send_info);		if (rv) {			module_put(intf->handlers->owner);			goto out_unlock;		}	}	write_lock_irqsave(&intf->users_lock, flags);	list_add_tail(&new_user->link, &intf->users);	write_unlock_irqrestore(&intf->users_lock, flags); out_unlock:		if (rv) {		kfree(new_user);	} else {		*user = new_user;	}	up_read(&interfaces_sem);	return rv;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/393d2cc354d150b8b4bb888a9da7db4c935e12bd/ipmi_msghandler.c/buggy/drivers/char/ipmi/ipmi_msghandler.c