[Intel-gfx] [PATCH] drm/i915/ppgtt: Prevent NULL deref in reset ioctl

Daniel Vetter daniel at ffwll.ch
Fri Dec 20 07:05:10 CET 2013


On Fri, Dec 20, 2013 at 12:22 AM, Ben Widawsky
<benjamin.widawsky at intel.com> wrote:
>         ctx = i915_gem_context_get(file->driver_priv, args->ctx_id);
> -       if (IS_ERR(ctx)) {
> +       if (IS_ERR_OR_NULL(ctx)) {

We now have half the callers check for IS_ERR and the others not.
Afaics i915_gem_context_get can only return NULL or a real context
though. Also from a quite read the expected error for a lookup failure
is ENOENT (and there seems to be a testcase for this).
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch



More information about the Intel-gfx mailing list