summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2017-03-30 16:32:53 +0300
committerDaniel Vetter <daniel.vetter@ffwll.ch>2017-03-30 21:23:51 +0300
commit031e5896dfdc24839d60f168f6e8560e294674d3 (patch)
treee6936f46b2930d4f1372b72d0f9d2fe460fd61e0
parentf5f4c615982ddf9b898439cd039e5af6697c1c3e (diff)
downloadlinux-031e5896dfdc24839d60f168f6e8560e294674d3.tar.xz
drm: Clear e after kfree in drm_mode_page_flip_ioctl
With the explicit retry loop static analyzers get confused by the control flow and believe that e could be accessed after kfree. That's not possible, but it's non-obvious, so let's clear it to NULL. We already cleared e = NULL at the top of the function, so this is all in line. Cc: Julia Lawall <julia.lawall@lip6.fr> Reported-by: Julia Lawall <julia.lawall@lip6.fr> Fixes: 29dc0d1de182 ("drm: Roll out acquire context for the page_flip ioctl") Cc: Harry Wentland <harry.wentland@amd.com> Cc: Daniel Vetter <daniel.vetter@intel.com> Cc: Jani Nikula <jani.nikula@linux.intel.com> Cc: Sean Paul <seanpaul@chromium.org> Reviewed-by: Harry Wentland <harry.wentland@amd.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/20170330133253.29500-1-daniel.vetter@ffwll.ch
-rw-r--r--drivers/gpu/drm/drm_plane.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_plane.c b/drivers/gpu/drm/drm_plane.c
index ec3e2e757800..5eca3184a747 100644
--- a/drivers/gpu/drm/drm_plane.c
+++ b/drivers/gpu/drm/drm_plane.c
@@ -923,6 +923,7 @@ retry:
ret = drm_event_reserve_init(dev, file_priv, &e->base, &e->event.base);
if (ret) {
kfree(e);
+ e = NULL;
goto out;
}
}