forked from Minki/linux
hpsa: fix bad -ENOMEM return value in hpsa_big_passthru_ioctl
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> Reviewed by: Mike MIller <michael.miller@canonical.com> Cc: <stable@vger.kernel.org> Signed-off-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
parent
d1fea47c36
commit
0758f4f732
@ -5093,7 +5093,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
|
||||
|
Loading…
Reference in New Issue
Block a user