Re: two 2.5 modules bugs

Rusty Russell (rusty@rustcorp.com.au)
Mon, 30 Dec 2002 17:13:07 +1100


In message <200212292018.VAA25446@harpo.it.uu.se> you write:
> >long". The obvious fix (untested) is:
> >
> Tested. This patch makes the parport_pc module work again. Thanks.

Linus, please apply. Mikael, thanks for the excellent bug report!

Rusty.

--
  Anyone who quotes me in their sig is an idiot. -- Rusty Russell.

Name: Fix MODULE_PARM for arrays of s. Author: Rusty Russell Status: Tested on 2.5.53 (by Mikael Pettersson)

D: I interpreted "1-10s" to mean a string of 1-10 chars. It actually D: means 1-10 comma-separated strings.

diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal .748-linux-2.5-bk/kernel/module.c .748-linux-2.5-bk.updated/kernel/module.c --- .748-linux-2.5-bk/kernel/module.c 2002-12-30 15:30:15.000000000 +1100 +++ .748-linux-2.5-bk.updated/kernel/module.c 2002-12-30 17:11:37.000000000 +1100 @@ -569,20 +569,6 @@ static int param_set_byte(const char *va return 0; } -static int param_string(const char *name, const char *val, - unsigned int min, unsigned int max, - char *dest) -{ - if (strlen(val) < min || strlen(val) > max) { - printk(KERN_ERR - "Parameter %s length must be %u-%u characters\n", - name, min, max); - return -EINVAL; - } - strcpy(dest, val); - return 0; -} - extern int set_obsolete(const char *val, struct kernel_param *kp) { unsigned int min, max; @@ -618,7 +604,8 @@ extern int set_obsolete(const char *val, return param_array(kp->name, val, min, max, obsparm->addr, sizeof(long), param_set_long); case 's': - return param_string(kp->name, val, min, max, obsparm->addr); + return param_array(kp->name, val, min, max, obsparm->addr, + sizeof(char *), param_set_charp); } printk(KERN_ERR "Unknown obsolete parameter type %s\n", obsparm->type); return -EINVAL; - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/