Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=43cdff92ad47e0ca024c8a07d29f9bb6119e759c
Commit:     43cdff92ad47e0ca024c8a07d29f9bb6119e759c
Parent:     7479b1ce5ea41a828002c60739cff37f47b62913
Author:     Sebastien Dugué <[EMAIL PROTECTED]>
AuthorDate: Fri Dec 29 16:46:53 2006 -0800
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Sat Dec 30 10:55:54 2006 -0800

    [PATCH] Fix IPMI watchdog set_param_str() using kstrdup
    
    set_param_str() cannot use kstrdup() to duplicate the parameter.  That's
    fine when the driver is compiled as a module but it sure is not when built
    into the kernel as the kernel parameters are parsed before the kmalloc
    slabs are setup.
    
    Signed-off-by: Sebastien Dugué <[EMAIL PROTECTED]>
    Acked-by: Corey Minyard <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 drivers/char/ipmi/ipmi_watchdog.c |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/char/ipmi/ipmi_watchdog.c 
b/drivers/char/ipmi/ipmi_watchdog.c
index 7828038..6b634e8 100644
--- a/drivers/char/ipmi/ipmi_watchdog.c
+++ b/drivers/char/ipmi/ipmi_watchdog.c
@@ -216,13 +216,13 @@ static int set_param_str(const char *val, struct 
kernel_param *kp)
 {
        action_fn  fn = (action_fn) kp->arg;
        int        rv = 0;
-       char       *dup, *s;
+       char       valcp[16];
+       char       *s;
 
-       dup = kstrdup(val, GFP_KERNEL);
-       if (!dup)
-               return -ENOMEM;
+       strncpy(valcp, val, 16);
+       valcp[15] = '\0';
 
-       s = strstrip(dup);
+       s = strstrip(valcp);
 
        down_read(&register_sem);
        rv = fn(s, NULL);
@@ -235,7 +235,6 @@ static int set_param_str(const char *val, struct 
kernel_param *kp)
 
  out_unlock:
        up_read(&register_sem);
-       kfree(dup);
        return rv;
 }
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to