linux-watchdog.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wim Van Sebroeck <wim@iguana.be>
To: Mike Waychison <mikew@google.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Linux Watchdog Mailing List <linux-watchdog@vger.kernel.org>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>
Subject: Re: [RFC] [PATCH 5/10] Generic Watchdog Timer Driver
Date: Wed, 23 Feb 2011 23:04:18 +0100	[thread overview]
Message-ID: <20110223220418.GA15279@infomag.iguana.be> (raw)
In-Reply-To: <4D65832C.9020203@google.com>

Hi Mike,

>> diff --git a/drivers/watchdog/core/watchdog_dev.c b/drivers/watchdog/core/watchdog_dev.c
>> index 2bf4f67..b80c6e6 100644
>> --- a/drivers/watchdog/core/watchdog_dev.c
>> +++ b/drivers/watchdog/core/watchdog_dev.c
>> @@ -221,6 +221,26 @@ static long watchdog_ioctl(struct file *file, unsigned int cmd,
>>   			return -EOPNOTSUPP;
>>   		watchdog_ping(wdd);
>>   		return 0;
>> +	case WDIOC_SETTIMEOUT:
>> +		if ((wdd->ops->set_timeout == NULL) ||
>> +		    !(wdd->info->options&  WDIOF_SETTIMEOUT))
>> +			return -EOPNOTSUPP;
>> +		if (get_user(val, p))
>> +			return -EFAULT;
>
> Should we sanity check that val > 0 here?  I realize that the driver  
> would need to do it's own sanity checking, but a value of 0 or < 0 makes  
> no sense to the core itself.
>
> Maybe timeout is best expressed as u32 if this is the case.

the sanity check is what is needed in patch 11. Here we should check that the value is between the low and high timeout value.
The timeout value should be an unsigned int at least. Up till now we used values from 1 till 65535.

I'll look into the code to see what val exactly was...

Kind regards,
Wim.


  reply	other threads:[~2011-02-23 22:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-23 20:43 [RFC] [PATCH 5/10] Generic Watchdog Timer Driver Wim Van Sebroeck
2011-02-23 21:59 ` Mike Waychison
2011-02-23 22:04   ` Wim Van Sebroeck [this message]
2011-02-24  8:21 ` Alexander Stein
2011-03-03 10:38   ` Wim Van Sebroeck
2011-03-03 12:53     ` Mark Brown
2011-03-03 16:36       ` Alexander Stein

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=20110223220418.GA15279@infomag.iguana.be \
    --to=wim@iguana.be \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=mikew@google.com \
    /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;
as well as URLs for NNTP newsgroup(s).