public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: "Stephen M. Cameron" <scameron@beardog.cce.hp.com>
To: james.bottomley@parallels.com
Cc: martin.petersen@oracle.com, linux-scsi@vger.kernel.org,
	stephenmcameron@gmail.com, joseph.t.handzik@hp.com,
	thenzl@redhat.com, michael.miller@canonical.com, elliott@hp.com,
	scott.teel@hp.com, hch@lst.de
Subject: [PATCH 2/5] hpsa: fix bad -ENOMEM return value in hpsa_big_passthru_ioctl
Date: Thu, 03 Jul 2014 10:18:03 -0500	[thread overview]
Message-ID: <20140703151803.22132.79451.stgit@beardog.cce.hp.com> (raw)
In-Reply-To: <20140703151534.22132.49663.stgit@beardog.cce.hp.com>

From: Stephen M. Cameron <scameron@beardog.cce.hp.com>

When copy_from_user fails, return -EFAULT, not -ENOMEM

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Reported-by: Robert Elliott <elliott@hp.com>
Reviewed-by: Joe Handzik <joseph.t.handzik@hp.com>
Reviewed-by: Scott Teel <scott.teel@hp.com>
Cc: <stable@vger.kernel.org>
---
 drivers/scsi/hpsa.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index 8cd1a9b..08b34e9 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -5092,7 +5092,7 @@ static int hpsa_big_passthru_ioctl(struct ctlr_info *h, void __user *argp)
 		}
 		if (ioc->Request.Type.Direction & XFER_WRITE) {
 			if (copy_from_user(buff[sg_used], data_ptr, sz)) {
-				status = -ENOMEM;
+				status = -EFAULT;
 				goto cleanup1;
 			}
 		} else


  parent reply	other threads:[~2014-07-03 15:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-03 15:17 [PATCH 0/5] hpsa a few small updates for early July 2014 Stephen M. Cameron
2014-07-03 15:17 ` [PATCH 1/5] hpsa: remove online devices from offline device list Stephen M. Cameron
2014-07-03 15:18 ` Stephen M. Cameron [this message]
2014-07-03 15:18 ` [PATCH 3/5] hpsa: make hpsa_init_one return -ENOMEM if allocation of h->lockup_detected fails Stephen M. Cameron
2014-07-03 15:18 ` [PATCH 4/5] hpsa: fix 6-byte READ/WRITE with 0 length data xfer Stephen M. Cameron
2014-07-03 15:18 ` [PATCH 5/5] hpsa: do not unconditionally copy sense data Stephen M. Cameron
2014-07-03 17:31 ` [PATCH 0/5] hpsa a few small updates for early July 2014 Christoph Hellwig

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=20140703151803.22132.79451.stgit@beardog.cce.hp.com \
    --to=scameron@beardog.cce.hp.com \
    --cc=elliott@hp.com \
    --cc=hch@lst.de \
    --cc=james.bottomley@parallels.com \
    --cc=joseph.t.handzik@hp.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=michael.miller@canonical.com \
    --cc=scott.teel@hp.com \
    --cc=stephenmcameron@gmail.com \
    --cc=thenzl@redhat.com \
    /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