spin_lock_irqsave(&(intf->events_lock), flags); 
spin_lock_irqsave(&intf->events_lock, flags); 
static int handle_read_event_rsp(ipmi_smi_t          intf,				 struct ipmi_smi_msg *msg){	struct ipmi_recv_msg *recv_msg, *recv_msg2;	struct list_head     msgs;	ipmi_user_t          user;	int                  rv = 0;	int                  deliver_count = 0;	unsigned long        flags;	if (msg->rsp_size < 19) {		/* Message is too small to be an IPMB event. */		spin_lock_irqsave(&intf->counter_lock, flags);		intf->invalid_events++;		spin_unlock_irqrestore(&intf->counter_lock, flags);		return 0;	}	if (msg->rsp[2] != 0) {		/* An error getting the event, just ignore it. */		return 0;	}	INIT_LIST_HEAD(&msgs);	spin_lock_irqsave(&(intf->events_lock), flags);	spin_lock(&intf->counter_lock);	intf->events++;	spin_unlock(&intf->counter_lock);	/* Allocate and fill in one message for every user that is getting	   events. */	list_for_each_entry(user, &(intf->users), link) {		if (! user->gets_events)			continue;		recv_msg = ipmi_alloc_recv_msg();		if (! recv_msg) {			list_for_each_entry_safe(recv_msg, recv_msg2, &msgs, link) {				list_del(&recv_msg->link);				ipmi_free_recv_msg(recv_msg);			}			/* We couldn't allocate memory for the                           message, so requeue it for handling                           later. */			rv = 1;			goto out;		}		deliver_count++;		copy_event_into_recv_msg(recv_msg, msg);		recv_msg->user = user;		list_add_tail(&(recv_msg->link), &msgs);	}	if (deliver_count) {		/* Now deliver all the messages. */		list_for_each_entry_safe(recv_msg, recv_msg2, &msgs, link) {			list_del(&recv_msg->link);			deliver_response(recv_msg);		}	} else if (intf->waiting_events_count < MAX_EVENTS_IN_QUEUE) {		/* No one to receive the message, put it in queue if there's		   not already too many things in the queue. */		recv_msg = ipmi_alloc_recv_msg();		if (! recv_msg) {			/* We couldn't allocate memory for the                           message, so requeue it for handling                           later. */			rv = 1;			goto out;		}		copy_event_into_recv_msg(recv_msg, msg);		list_add_tail(&(recv_msg->link), &(intf->waiting_events));	} else {		/* There's too many things in the queue, discard this		   message. */		printk(KERN_WARNING PFX "Event queue full, discarding an"		       " incoming event\n");	} out:	spin_unlock_irqrestore(&(intf->events_lock), flags);	return rv;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/393d2cc354d150b8b4bb888a9da7db4c935e12bd/ipmi_msghandler.c/clean/drivers/char/ipmi/ipmi_msghandler.c