/* Memory scanning is a long process and it needs to be interruptable. This function checks whether such interrupt condition occured.  */
static int scan_should_stop(void)
/* Memory scanning is a long process and it needs to be interruptable. This function checks whether such interrupt condition occured.  */
static int scan_should_stop(void)
{
	if (!atomic_read(&kmemleak_enabled))
		return 1;
	if (current->mm)
		return signal_pending(current);
	else
		return kthread_should_stop();
	return 0;
}