Commit 13ca262a authored by Stephen M. Cameron's avatar Stephen M. Cameron Committed by Greg Kroah-Hartman

hpsa: fix bad -ENOMEM return value in hpsa_big_passthru_ioctl

commit 0758f4f7 upstream.

When copy_from_user fails, return -EFAULT, not -ENOMEM
Signed-off-by: default avatarStephen M. Cameron <scameron@beardog.cce.hp.com>
Reported-by: default avatarRobert Elliott <elliott@hp.com>
Reviewed-by: default avatarJoe Handzik <joseph.t.handzik@hp.com>
Reviewed-by: default avatarScott Teel <scott.teel@hp.com>
Reviewed by: Mike MIller <michael.miller@canonical.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d3e12331
...@@ -5092,7 +5092,7 @@ static int hpsa_big_passthru_ioctl(struct ctlr_info *h, void __user *argp) ...@@ -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 (ioc->Request.Type.Direction & XFER_WRITE) {
if (copy_from_user(buff[sg_used], data_ptr, sz)) { if (copy_from_user(buff[sg_used], data_ptr, sz)) {
status = -ENOMEM; status = -EFAULT;
goto cleanup1; goto cleanup1;
} }
} else } else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment