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 2/3] Staging: sst: more dereferencing user pointers
Date: Thu, 21 Oct 2010 18:01:04 +0000	[thread overview]
Message-ID: <20101021180104.GG5985@bicker> (raw)
In-Reply-To: <20101019055704.GD5839@bicker>

On Thu, Oct 21, 2010 at 07:45:45PM +0530, Koul, Vinod wrote:
> >  	case _IOC_NR(SNDRV_SST_STREAM_SET_PARAMS): {
> > -		struct snd_sst_params *str_param = (struct snd_sst_params *)arg;
> > +		struct snd_sst_params str_param;
> Now this is a struct...
> > 
> [snip]
> > +
> >  		if (!str_id) {
> So this becomes bogus check, can be removed :-)

The check for str_id?  That comes from near the start of the function
and it's still needed.

> > 
> > +				retval = copy_to_user(dest, &retval, sizeof(__u32));
> >  				if (retval)
> >  					retval = -EFAULT;
> Trivial but this can be changed to 
> 				if (copy_to_user())
> 					retval = -EFAULT;	
> 
retval is the str_id here so you'd need an else statement as well.
				else
					retval = 0;
I can send a separate patch for this.

> Overall its good, tested it as well,

Thanks for that.

regards,
dan carpenter


  parent reply	other threads:[~2010-10-21 18:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-19  5:57 [patch 2/3] Staging: sst: more dereferencing user pointers Dan Carpenter
2010-10-21 14:27 ` Koul, Vinod
2010-10-21 18:01 ` Dan Carpenter [this message]
2010-10-22  4:20 ` Koul, Vinod

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=20101021180104.GG5985@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