public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: "tiejun.chen" <tiejun.chen@windriver•com>
To: Tabi Timur-B04825 <B04825@freescale•com>
Cc: "linux-watchdog@vger•kernel.org" <linux-watchdog@vger•kernel.org>,
	"linuxppc-dev@ozlabs•org" <linuxppc-dev@ozlabs•org>
Subject: Re: [PATCH 1/1] booke/wdt: fix incorrect WDIOC_GETSUPPORT return path
Date: Tue, 7 Aug 2012 09:56:03 +0800	[thread overview]
Message-ID: <502075B3.3020605@windriver.com> (raw)
In-Reply-To: <CAOZdJXWYyc_=iikFwSLy4gX7Grag=jxvWhYrP4Y9U3QZcwieBw@mail.gmail.com>

On 08/07/2012 09:19 AM, Tabi Timur-B04825 wrote:
> On Mon, Aug 6, 2012 at 2:12 PM, Tabi Timur-B04825 <b04825@freescale•com> wrote:
>> On Mon, Jul 30, 2012 at 3:15 AM, Tiejun Chen <tiejun.chen@windriver•com> wrote:
>>> We miss that correct WDIOC_GETSUPPORT return path when perform
>>> copy_to_user() properly.
>>
>> Thanks for catching this.  I'm amazed that this driver still has bugs like this.
> 
> While you're at it, I found a few related bugs.  Can you fix these, also?
> 
> 1.	case WDIOC_SETOPTIONS:
> 		if (get_user(tmp, p))
> 			return -EINVAL;
> 
> This should return -EFAULT.
> 
> 2. 	case WDIOC_GETBOOTSTATUS:
> 		/* XXX: something is clearing TSR */
> 		tmp = mfspr(SPRN_TSR) & TSR_WRS(3);
> 		/* returns CARDRESET if last reset was caused by the WDT */
> 		return (tmp ? WDIOF_CARDRESET : 0);
> 
> This should use put_user() to return the value, instead of returning
> it as a return code.
> 
> You can title the new patch something like, "booke/wdt: some ioctls do
> not return values properly"

Will regenerate this patch including these error as v2.

Thanks
Tiejun

      reply	other threads:[~2012-08-07  2:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-30  8:15 [PATCH 1/1] booke/wdt: fix incorrect WDIOC_GETSUPPORT return path Tiejun Chen
2012-08-06  3:10 ` tiejun.chen
2012-08-06 16:13   ` Kumar Gala
2012-08-06 23:27 ` Tabi Timur-B04825
2012-08-06 23:36   ` Tabi Timur-B04825
2012-08-07  1:56     ` tiejun.chen [this message]

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=502075B3.3020605@windriver.com \
    --to=tiejun.chen@windriver$(echo .)com \
    --cc=B04825@freescale$(echo .)com \
    --cc=linux-watchdog@vger$(echo .)kernel.org \
    --cc=linuxppc-dev@ozlabs$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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