From: Randy Dunlap Date: Thu, 12 Apr 2007 06:28:41 +0000 (-0700) Subject: [PATCH] fix kernel oops with badly formatted module option X-Git-Tag: v2.6.21-rc7~20 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=fe20e581a72979917e35d5146458ceba79be391f;p=linux-2.6-omap-h63xx.git [PATCH] fix kernel oops with badly formatted module option Catch malformed kernel parameter usage of "param = value". Spaces are not supported, but don't cause a kernel fault on such usage, just report an error. Signed-off-by: Randy Dunlap Acked-by: Larry Finger Acked-by: Rusty Russell Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/kernel/params.c b/kernel/params.c index e265b13195b..1fc4ac746cd 100644 --- a/kernel/params.c +++ b/kernel/params.c @@ -356,6 +356,10 @@ int param_set_copystring(const char *val, struct kernel_param *kp) { struct kparam_string *kps = kp->arg; + if (!val) { + printk(KERN_ERR "%s: missing param set value\n", kp->name); + return -EINVAL; + } if (strlen(val)+1 > kps->maxlen) { printk(KERN_ERR "%s: string doesn't fit in %u chars.\n", kp->name, kps->maxlen-1);