The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: "Edward A. James" <eajames@us.ibm.com>
Cc: linux-kernel@vger.kernel.org, bradleyb@fuzziesquirrel.com,
	jk@ozlabs.org, cbostic@linux.vnet.ibm.com, joel@jms.id.au,
	andrew@aj.id.au
Subject: Re: [PATCH linux] drivers/fsi: Add SBEFIFO FSI client device driver
Date: Thu, 15 Jun 2017 07:24:37 +0200	[thread overview]
Message-ID: <20170615052437.GA29481@kroah.com> (raw)
In-Reply-To: <1497469647-4608-1-git-send-email-eajames@us.ibm.com>

On Wed, Jun 14, 2017 at 02:47:27PM -0500, Edward A. James wrote:
> +static ssize_t sbefifo_read(struct file *file, char __user *buf,
> +		size_t len, loff_t *offset)
> +{
> +	struct sbefifo_client *client = file->private_data;
> +
> +	WARN_ON(*offset);

Huh?  Why?

> +	if (!access_ok(VERIFY_WRITE, buf, len))
> +		return -EFAULT;

What does this check?  You should never need to call access_ok in any
driver, copy_from/to_user handles that all for you just fine.

thanks,

greg k-h

  parent reply	other threads:[~2017-06-15  5:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-14 19:47 [PATCH linux] drivers/fsi: Add SBEFIFO FSI client device driver Edward A. James
2017-06-15  5:18 ` Greg KH
2017-06-15  5:18 ` Greg KH
2017-06-15  5:19 ` Greg KH
2017-06-15  5:24 ` Greg KH [this message]
2017-06-15  5:26 ` Greg KH
     [not found] <6363b930-6a69-daf7-c1b5-b1e5ccbc5170@linux.vnet.ibm.com>
2017-06-20 16:34 ` Eddie James

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=20170615052437.GA29481@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=andrew@aj.id.au \
    --cc=bradleyb@fuzziesquirrel.com \
    --cc=cbostic@linux.vnet.ibm.com \
    --cc=eajames@us.ibm.com \
    --cc=jk@ozlabs.org \
    --cc=joel@jms.id.au \
    --cc=linux-kernel@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