static void lkdtm_handler(void) { count--; printk(KERN_INFO "lkdtm: Crash point %s of type %s hit, trigger in %d rounds\n", cp_name_to_str(cpoint), cp_type_to_str(cptype), count); if (count == 0) { lkdtm_do_action(cptype); count = cpoint_count; } }
static void lkdtm_handler(void) { unsigned long flags; bool do_it = false; spin_lock_irqsave(&count_lock, flags); count--; pr_info("Crash point %s of type %s hit, trigger in %d rounds\n", cp_name_to_str(cpoint), cp_type_to_str(cptype), count); if (count == 0) { do_it = true; count = cpoint_count; } spin_unlock_irqrestore(&count_lock, flags); if (do_it) lkdtm_do_action(cptype); }