Quoting Tvrtko Ursulin (2019-12-17 16:18:14)
> From: Tvrtko Ursulin <[email protected]>
> 
> Get_pid_task() needs to be paired with a put_pid or we leak a pid
> reference every time a banned client tries to create a context.
> 
> Signed-off-by: Tvrtko Ursulin <[email protected]>
> Fixes: b083a0870c79 ("drm/i915: Add per client max context ban limit")
> Cc: Chris Wilson <[email protected]>
> Cc: Mika Kuoppala <[email protected]>
> ---
>  drivers/gpu/drm/i915/gem/i915_gem_context.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_context.c 
> b/drivers/gpu/drm/i915/gem/i915_gem_context.c
> index 46b4d1d643f8..eace1607ceb2 100644
> --- a/drivers/gpu/drm/i915/gem/i915_gem_context.c
> +++ b/drivers/gpu/drm/i915/gem/i915_gem_context.c
> @@ -2193,9 +2193,11 @@ int i915_gem_context_create_ioctl(struct drm_device 
> *dev, void *data,
>  
>         ext_data.fpriv = file->driver_priv;
>         if (client_is_banned(ext_data.fpriv)) {
> +               struct pid *pid = get_task_pid(current, PIDTYPE_PID);
> +
>                 DRM_DEBUG("client %s[%d] banned from creating ctx\n",
> -                         current->comm,
> -                         pid_nr(get_task_pid(current, PIDTYPE_PID)));
> +                         current->comm, pid_nr(pid));

Or, going out on a limb here, task_pid_nr(current)).
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to