Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 254105
b: refs/heads/master
c: aa2c96d
h: refs/heads/master
i:
  254103: 0039840
v: v3
  • Loading branch information
Josh Hunt authored and Linus Torvalds committed Jun 28, 2011
1 parent e6f1372 commit b964aa1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 507c5f1224014f9956e604ee8703b3bbea7da4a4
refs/heads/master: aa2c96d6f329e66cc59352b0f12e8f04e6a9593b
8 changes: 8 additions & 0 deletions trunk/drivers/misc/lkdtm.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ static int recur_count = REC_NUM_DEFAULT;
static enum cname cpoint = CN_INVALID;
static enum ctype cptype = CT_NONE;
static int count = DEFAULT_COUNT;
static DEFINE_SPINLOCK(count_lock);

module_param(recur_count, int, 0644);
MODULE_PARM_DESC(recur_count, " Recursion level for the stack overflow test, "\
Expand Down Expand Up @@ -230,11 +231,14 @@ static const char *cp_name_to_str(enum cname name)
static int lkdtm_parse_commandline(void)
{
int i;
unsigned long flags;

if (cpoint_count < 1 || recur_count < 1)
return -EINVAL;

spin_lock_irqsave(&count_lock, flags);
count = cpoint_count;
spin_unlock_irqrestore(&count_lock, flags);

/* No special parameters */
if (!cpoint_type && !cpoint_name)
Expand Down Expand Up @@ -349,6 +353,9 @@ static void lkdtm_do_action(enum ctype which)

static void lkdtm_handler(void)
{
unsigned long flags;

spin_lock_irqsave(&count_lock, flags);
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);
Expand All @@ -357,6 +364,7 @@ static void lkdtm_handler(void)
lkdtm_do_action(cptype);
count = cpoint_count;
}
spin_unlock_irqrestore(&count_lock, flags);
}

static int lkdtm_register_cpoint(enum cname which)
Expand Down

0 comments on commit b964aa1

Please sign in to comment.