public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Larry Finger <larry.finger@lwfinger.net>
To: Randy Dunlap <randy.dunlap@oracle.com>
Cc: LKML <linux-kernel@vger.kernel.org>, rusty@rustcorp.com.au
Subject: Re: [PATCH] Re: kernel oops with badly formatted module option
Date: Sat, 07 Apr 2007 22:43:15 -0500	[thread overview]
Message-ID: <461864D3.7050407@lwfinger.net> (raw)
In-Reply-To: <20070407194700.38138108.randy.dunlap@oracle.com>

Randy Dunlap wrote:
> On Sat, 07 Apr 2007 19:21:01 -0500 Larry Finger wrote:
> 
>> With the following line in /etc/modprobe.conf.local:
>>
>> options bcm43xx fwpostfix = ".fw3" locale=8
>>
>> the kernel oops below is generated. I realize that the line should have no whitespace around the 
>> "=", but I do not feel that an oops is the best way to report the syntax error. Could there be a more gentle failure?
> 
> 
> From: Randy Dunlap <randy.dunlap@oracle.com>
> 
> 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>
It works here.  ACKed by: Larry Finger <Larry.Finger@lwfinger.net>

> ---
>  kernel/params.c |    4 ++++
>  1 file changed, 4 insertions(+)
> 
> --- linux-2.6.21-rc6.orig/kernel/params.c
> +++ linux-2.6.21-rc6/kernel/params.c
> @@ -356,6 +356,10 @@ int param_set_copystring(const char *val
>  {
>  	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);
> 


  reply	other threads:[~2007-04-08  3:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-08  0:21 kernel oops with badly formatted module option Larry Finger
2007-04-08  2:47 ` [PATCH] " Randy Dunlap
2007-04-08  3:43   ` Larry Finger [this message]
2007-04-09  1:24   ` Rusty Russell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=461864D3.7050407@lwfinger.net \
    --to=larry.finger@lwfinger.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=randy.dunlap@oracle.com \
    --cc=rusty@rustcorp.com.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox