public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: kernel-janitors@vger.kernel.org
Subject: Re: [patch 1/2] Staging: intel_sst: return -EFAULT if
Date: Fri, 15 Oct 2010 14:24:17 +0000	[thread overview]
Message-ID: <20101015142417.GL6614@bicker> (raw)
In-Reply-To: <20101015034407.GI6614@bicker>

On Fri, Oct 15, 2010 at 01:59:48PM +0100, Alan Cox wrote:
> On Fri, 15 Oct 2010 07:29:01 +0200
> Dan Carpenter <error27@gmail.com> wrote:
> 
> > On Fri, Oct 15, 2010 at 09:53:57AM +0530, Koul, Vinod wrote:
> > > > @@ -938,7 +940,7 @@ long intel_sst_ioctl(struct file *file_ptr,
> > > > unsigned int cmd, unsigned long arg)
> > > >  		retval = copy_to_user((struct snd_sst_vol *)arg,
> > > >  						&get_vol,
> > > > sizeof(get_vol)); if (retval) {
> > > > -			retval = -EIO;
> > > > +			retval = -EFAULT;
> > > >  			break;
> > > >  		}
> > > >  		/*sst_print_get_vol_info(str_id, &get_vol);*/
> > > Since retval is not used and value assigned is supposed to be
> > > -EFAULT, how about this?
> > > 	if(copy_to_user())
> > > 			return -EIO;
> > > 
> > 
> > No. No.  retval is used.  We can't return directly because we need to
> > call unlock_kernel().
> 
> Dan - your tree is a couple of patches stale at this point if it has
> the lock_kernel in it - the lock_kernel has gone in the latest
> submission.

Yes.  That went in last night.  Vinod already told me.

I'll submit another patch which changes the file to the
	if (copy_to_user())
		retval = -EFAULT;
format.  It will apply on top of the patches I sent already.

There are some other bugs I noticed when I wrote that so it's worth it
to clean it up.

regards,
dan carpenter

      parent reply	other threads:[~2010-10-15 14:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-15  3:44 [patch 1/2] Staging: intel_sst: return -EFAULT if copy_to_user() Dan Carpenter
2010-10-15  4:35 ` [patch 1/2] Staging: intel_sst: return -EFAULT if Koul, Vinod
2010-10-15  5:29 ` Dan Carpenter
2010-10-15  5:51 ` Koul, Vinod
2010-10-15 12:58 ` Alan Cox
2010-10-15 12:59 ` Alan Cox
2010-10-15 14:24 ` Dan Carpenter [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=20101015142417.GL6614@bicker \
    --to=error27@gmail.com \
    --cc=kernel-janitors@vger.kernel.org \
    /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