summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2017-02-07 18:39:05 +0900
committerMichel Dänzer <michel@daenzer.net>2017-02-08 16:01:24 +0900
commit481394e3c9f9f7d88bb66fe9ae8834c87952a8ab (patch)
treeee687887ae60b0dd1cdacd776314b3066942a0f1 /src
parent80fc78633962c1ec996b1721bfb757b98dc85bfc (diff)
Fix flip event data leak if calloc or drmModeAddFB fails
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'src')
-rw-r--r--src/drmmode_display.c4
-rw-r--r--src/radeon_dri2.c4
2 files changed, 5 insertions, 3 deletions
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 0fb0d770..9f787203 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -2904,8 +2904,10 @@ error:
radeon_drm_abort_entry(drm_queue_seq);
else if (crtc)
drmmode_flip_abort(crtc, flipdata);
- else if (flipdata && flipdata->flip_count <= 1)
+ else {
+ abort(NULL, data);
free(flipdata);
+ }
xf86DrvMsg(scrn->scrnIndex, X_WARNING, "Page flip failed: %s\n",
strerror(errno));
diff --git a/src/radeon_dri2.c b/src/radeon_dri2.c
index 860ff290..d0dcf890 100644
--- a/src/radeon_dri2.c
+++ b/src/radeon_dri2.c
@@ -579,9 +579,9 @@ xf86CrtcPtr radeon_dri2_drawable_crtc(DrawablePtr pDraw, Bool consider_disabled)
static void
radeon_dri2_flip_event_abort(xf86CrtcPtr crtc, void *event_data)
{
- RADEONInfoPtr info = RADEONPTR(crtc->scrn);
+ if (crtc)
+ RADEONPTR(crtc->scrn)->drmmode.dri2_flipping = FALSE;
- info->drmmode.dri2_flipping = FALSE;
free(event_data);
}