]> git.baikalelectronics.ru Git - kernel.git/commit
drm: fix null pointer dereference on null state pointer
authorColin Ian King <colin.king@canonical.com>
Sat, 22 Dec 2018 13:00:46 +0000 (13:00 +0000)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Mon, 24 Dec 2018 10:52:43 +0000 (11:52 +0100)
commit8d097933b44bc811814784f9cf156c0119b64430
treece2800348f3c1c9a83a792a49b692dd924565096
parentedcea9a43e1f8696ba461bc027bc149e0efddd2f
drm: fix null pointer dereference on null state pointer

In the case where state cannot be allocated, the current exit path via
label 'out' will dereference the null state pointer when calling
drm_atomic_state_put. Fix this by adding a new error exit label and
jumping to this to avoid the drm_atomic_state_put.

Detected by CoverityScan, CID#1476034 ("Dereference after null check")

Fixes: aedceaddcd46 ("drm: Add helper to implement legacy dirtyfb")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20181222130046.14083-1-colin.king@canonical.com
drivers/gpu/drm/drm_damage_helper.c