summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2015-11-11 15:59:06 +0900
committerMichel Dänzer <michel@daenzer.net>2015-11-12 11:27:28 +0900
commitc6fc7e309a8a922f94a1f5f3e8bfb9058cff7ad1 (patch)
tree32824ad7fa1b3fddb88494cf8c63e2be2586c77b
parent4e4f4d53da0539ef9feb8766230a6e9927ae005b (diff)
Properly handle drmModeAddFB failure in drmmode_crtc_scanout_allocate
We were printing an error message, but not propagating the failure. That would probably lead to trouble down the road. (ported from amdgpu commit 21e72fb2418b5cc7fc849a9cf951186e209036b0) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--src/drmmode_display.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 22b84da3..17e52316 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -555,8 +555,12 @@ drmmode_crtc_scanout_allocate(xf86CrtcPtr crtc,
pScrn->bitsPerPixel, rotate_pitch,
scanout->bo->handle,
&scanout->fb_id);
- if (ret)
+ if (ret) {
ErrorF("failed to add scanout fb\n");
+ radeon_bo_unref(scanout->bo);
+ scanout->bo = NULL;
+ return NULL;
+ }
scanout->width = width;
scanout->height = height;