up_read(&interfaces_sem); 
 /* Allow the entry to be reused now. */ spin_lock_irqsave(&interfaces_lock, flags); ipmi_interfaces[i] = NULL; spin_unlock_irqrestore(&interfaces_lock,flags);  kref_put(&intf->refcount, intf_free); 
int ipmi_unregister_smi(ipmi_smi_t intf){	int                     rv = -ENODEV;	int                     i;	struct ipmi_smi_watcher *w;	unsigned long           flags;	down_write(&interfaces_sem);	if (list_empty(&(intf->users)))	{		for (i = 0; i < MAX_IPMI_INTERFACES; i++) {			if (ipmi_interfaces[i] == intf) {				remove_proc_entries(intf);				spin_lock_irqsave(&interfaces_lock, flags);				ipmi_interfaces[i] = NULL;				clean_up_interface_data(intf);				spin_unlock_irqrestore(&interfaces_lock,flags);				kfree(intf);				rv = 0;				goto out_call_watcher;			}		}	} else {		rv = -EBUSY;	}	up_write(&interfaces_sem);	return rv; out_call_watcher:	downgrade_write(&interfaces_sem);	/* Call all the watcher interfaces to tell them that	   an interface is gone. */	down_read(&smi_watchers_sem);	list_for_each_entry(w, &smi_watchers, link) {		w->smi_gone(i);	}	up_read(&smi_watchers_sem);	up_read(&interfaces_sem);	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/393d2cc354d150b8b4bb888a9da7db4c935e12bd/ipmi_msghandler.c/clean/drivers/char/ipmi/ipmi_msghandler.c