Thread (202 messages) 202 messages, 6 authors, 2014-09-17
STALE4315d REVIEWED: 2 (0M)

[PATCH 3.13 094/187] hpsa: fix bad -ENOMEM return value in hpsa_big_passthru_ioctl

From: Kamal Mostafa <hidden>
Date: 2014-09-15 22:11:18
Also in: lkml
Subsystem: hewlett-packard smart array raid driver (hpsa), scsi subsystem, the rest · Maintainers: Don Brace, "James E.J. Bottomley", "Martin K. Petersen", Linus Torvalds

3.13.11.7 -stable review patch.  If anyone has any objections, please let me know.

------------------

From: "Stephen M. Cameron" <redacted>

commit 0758f4f732b08b6ef07f2e5f735655cf69fea477 upstream.

When copy_from_user fails, return -EFAULT, not -ENOMEM

Signed-off-by: Stephen M. Cameron <redacted>
Reported-by: Robert Elliott <redacted>
Reviewed-by: Joe Handzik <redacted>
Reviewed-by: Scott Teel <redacted>
Reviewed by: Mike MIller [off-list ref]
Signed-off-by: Christoph Hellwig <hch@lst.de>

Signed-off-by: Kamal Mostafa <redacted>
---
 drivers/scsi/hpsa.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index ad034ab..d518bba 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -3151,7 +3151,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
-- 
1.9.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help