/* Empty local completion list as well */ list_splice_init(&mad_agent_priv->local_list, &cancel_list); 
static void cancel_mads(struct ib_mad_agent_private *mad_agent_priv){	unsigned long flags;	struct ib_mad_send_wr_private *mad_send_wr, *temp_mad_send_wr;	struct ib_mad_send_wc mad_send_wc;	struct list_head cancel_list;	INIT_LIST_HEAD(&cancel_list);	spin_lock_irqsave(&mad_agent_priv->lock, flags);	list_for_each_entry_safe(mad_send_wr, temp_mad_send_wr,				 &mad_agent_priv->send_list, agent_list) {		if (mad_send_wr->status == IB_WC_SUCCESS) { 			mad_send_wr->status = IB_WC_WR_FLUSH_ERR;			mad_send_wr->refcount -= (mad_send_wr->timeout > 0);		}	}	/* Empty wait list to prevent receives from finding a request */	list_splice_init(&mad_agent_priv->wait_list, &cancel_list);	spin_unlock_irqrestore(&mad_agent_priv->lock, flags);	/* Report all cancelled requests */	mad_send_wc.status = IB_WC_WR_FLUSH_ERR;	mad_send_wc.vendor_err = 0;	list_for_each_entry_safe(mad_send_wr, temp_mad_send_wr,				 &cancel_list, agent_list) {		mad_send_wc.wr_id = mad_send_wr->wr_id;		mad_agent_priv->agent.send_handler(&mad_agent_priv->agent,						   &mad_send_wc);		list_del(&mad_send_wr->agent_list);		kfree(mad_send_wr);		atomic_dec(&mad_agent_priv->refcount);	}}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/2c153b934dca08d58e0aafde18a182e0891aa201/mad.c/buggy/drivers/infiniband/core/mad.c