lkml.org 
[lkml]   [2022]   [Mar]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 08/30] drivers: hv: dxgkrnl: Creation of dxgcontext objects
On Tue, Mar 01, 2022 at 11:45:55AM -0800, Iouri Tarassov wrote:
[...]
> +static int
> +dxgk_create_context_virtual(struct dxgprocess *process, void *__user inargs)
> +{
> + struct d3dkmt_createcontextvirtual args;
> + int ret;
> + struct dxgadapter *adapter = NULL;
> + struct dxgdevice *device = NULL;
> + struct dxgcontext *context = NULL;
> + struct d3dkmthandle host_context_handle = {};
> + bool device_lock_acquired = false;
> +
> + pr_debug("ioctl: %s", __func__);
> +
> + ret = copy_from_user(&args, inargs, sizeof(args));
> + if (ret) {
> + pr_err("%s failed to copy input args", __func__);
> + ret = -EINVAL;

This should be -EFAULT. This goes for other copy_from_user calls too. You can also
drop the pr_err above.

Thanks,
Wei.

\
 
 \ /
  Last update: 2022-03-02 14:00    [W:0.170 / U:0.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site