mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-02 16:55:16 -04:00
staging: lustre: obdclass: return -EFAULT if copy_from_user() fails
The copy_from_user() function returns the number of bytes which we
weren't able to copy. We don't want to return that to the user but
instead we want to return -EFAULT.
Fixes: d7e09d0397 ("staging: add Lustre file system client support")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
3ca121c2f4
commit
092c3def24
@@ -180,7 +180,8 @@ int class_handle_ioctl(unsigned int cmd, unsigned long arg)
|
||||
err = -ENOMEM;
|
||||
goto out;
|
||||
}
|
||||
err = copy_from_user(lcfg, data->ioc_pbuf1, data->ioc_plen1);
|
||||
if (copy_from_user(lcfg, data->ioc_pbuf1, data->ioc_plen1))
|
||||
err = -EFAULT;
|
||||
if (!err)
|
||||
err = lustre_cfg_sanity_check(lcfg, data->ioc_plen1);
|
||||
if (!err)
|
||||
|
||||
Reference in New Issue
Block a user