summaryrefslogtreecommitdiff
path: root/kernel/params.c
diff options
context:
space:
mode:
authorRandy Dunlap <randy.dunlap@oracle.com>2007-04-11 23:28:41 -0700
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-04-12 15:31:41 -0700
commitfe20e581a72979917e35d5146458ceba79be391f (patch)
tree37c5d2639da3c4c1ad9aa5d1fc0e3fa124b1f071 /kernel/params.c
parent80584ff3b99c36ead7e130e453b3a48b18072d18 (diff)
downloadlinux-fe20e581a72979917e35d5146458ceba79be391f.tar.gz
[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 <randy.dunlap@oracle.com> Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Acked-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/params.c')
-rw-r--r--kernel/params.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/params.c b/kernel/params.c
index e265b13195b1..1fc4ac746cd8 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);