Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 29065
b: refs/heads/master
c: 66f969d
h: refs/heads/master
i:
  29063: e3ddc9a
v: v3
  • Loading branch information
Pekka Enberg authored and Linus Torvalds committed Jun 23, 2006
1 parent 7f418e3 commit 9026095
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 481fad483487ea967fe20bbc9e565d787f7bf20f
refs/heads/master: 66f969d064e46e6690c3426e2af846e76fb80e83
25 changes: 9 additions & 16 deletions trunk/drivers/char/ipmi/ipmi_watchdog.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,24 +212,16 @@ static int set_param_str(const char *val, struct kernel_param *kp)
{
action_fn fn = (action_fn) kp->arg;
int rv = 0;
const char *end;
char valcp[16];
int len;

/* Truncate leading and trailing spaces. */
while (isspace(*val))
val++;
end = val + strlen(val) - 1;
while ((end >= val) && isspace(*end))
end--;
len = end - val + 1;
if (len > sizeof(valcp) - 1)
return -EINVAL;
memcpy(valcp, val, len);
valcp[len] = '\0';
char *dup, *s;

dup = kstrdup(val, GFP_KERNEL);
if (!dup)
return -ENOMEM;

s = strstrip(dup);

down_read(&register_sem);
rv = fn(valcp, NULL);
rv = fn(s, NULL);
if (rv)
goto out_unlock;

Expand All @@ -239,6 +231,7 @@ static int set_param_str(const char *val, struct kernel_param *kp)

out_unlock:
up_read(&register_sem);
kfree(dup);
return rv;
}

Expand Down

0 comments on commit 9026095

Please sign in to comment.