/* Only do anything when DOIT is set, otherwise just free the list (this is used for clean pages which do not need killing) Also when FAIL is set do a force kill because something went wrong earlier.  */
static void kill_procs_ao(struct list_head *to_kill, int doit, int trapno, int fail, unsigned long pfn)
/* Only do anything when DOIT is set, otherwise just free the list (this is used for clean pages which do not need killing) Also when FAIL is set do a force kill because something went wrong earlier.  */
static void kill_procs_ao(struct list_head *to_kill, int doit, int trapno, int fail, unsigned long pfn)
{
	struct to_kill *tk, *next;
	list_for_each_entry_safe (tk, next, to_kill, nd) {
		if (doit) {
			if (fail || tk->addr_valid == 0) {
				printk(KERN_ERR
		"MCE %#lx: forcibly killing %s:%d because of failure to unmap corrupted page\n",
					pfn, tk->tsk->comm, tk->tsk->pid);
				force_sig(SIGKILL, tk->tsk);
			}
			else if (kill_proc_ao(tk->tsk, tk->addr, trapno,
					      pfn) < 0)
				printk(KERN_ERR
		"MCE %#lx: Cannot send advisory machine check signal to %s:%d\n",
					pfn, tk->tsk->comm, tk->tsk->pid);
		}
		put_task_struct(tk->tsk);
		kfree(tk);
	}
}