mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Richard Cochran <richardcochran@gmail.com>
To: John Stultz <john.stultz@linaro.org>
Cc: Dan Carpenter <error27@gmail.com>,
	Richard Cochran <richard.cochran@omicron.at>,
	"David S. Miller" <davem@davemloft.net>,
	Arnd Bergmann <arnd@arndb.de>,
	open list <linux-kernel@vger.kernel.org>,
	kernel-janitors@vger.kernel.org,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [patch 1/2] ptp: return -EFAULT on copy_to_user() errors
Date: Wed, 1 Jun 2011 12:16:42 +0200	[thread overview]
Message-ID: <20110601101642.GA8928@riccoc20.at.omicron.at> (raw)
In-Reply-To: <1306910780.3359.53.camel@work-vm>

On Tue, May 31, 2011 at 11:46:20PM -0700, John Stultz wrote:
> On Mon, 2011-05-30 at 08:12 +0200, Richard Cochran wrote:
> > On Sun, May 29, 2011 at 10:53:12PM +0300, Dan Carpenter wrote:
> > > copy_to_user() returns the number of bytes remaining, but we want a
> > > negative error code here.
> > > 
> > > Signed-off-by: Dan Carpenter <error27@gmail.com>
> > > 
> > > diff --git a/drivers/ptp/ptp_chardev.c b/drivers/ptp/ptp_chardev.c
> > > index a8d03ae..93fa22d 100644
> > > --- a/drivers/ptp/ptp_chardev.c
> > > +++ b/drivers/ptp/ptp_chardev.c
> > > @@ -46,7 +46,8 @@ long ptp_ioctl(struct posix_clock *pc, unsigned int cmd, unsigned long arg)
> > >  		caps.n_ext_ts = ptp->info->n_ext_ts;
> > >  		caps.n_per_out = ptp->info->n_per_out;
> > >  		caps.pps = ptp->info->pps;
> > > -		err = copy_to_user((void __user *)arg, &caps, sizeof(caps));
> > > +		if (copy_to_user((void __user *)arg, &caps, sizeof(caps)))
> > > +			err = -EFAULT;
> > 
> > Yes, right, and thanks for the extra review.
> > 
> > Thomas, can you please queue these two patches for 3.0-rc2?
> > 
> > (Or should John Stultz handle this sort of thing?)
> 
> Queued in my tree.
> 
> Richard, Since you like these, do you mind formally acking them so I can
> add that?

Acked-by: Richard Cochran <richard.cochran@omicron.at>

      reply	other threads:[~2011-06-01 10:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-29 19:53 Dan Carpenter
2011-05-30  6:12 ` Richard Cochran
2011-06-01  6:46   ` John Stultz
2011-06-01 10:16     ` Richard Cochran [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=20110601101642.GA8928@riccoc20.at.omicron.at \
    --to=richardcochran@gmail.com \
    --cc=arnd@arndb.de \
    --cc=davem@davemloft.net \
    --cc=error27@gmail.com \
    --cc=john.stultz@linaro.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=richard.cochran@omicron.at \
    --cc=tglx@linutronix.de \
    /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

all inboxes | Powered by JetHome®