summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/xe/display/intel_fb_bo.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2024-04-19 10:40:04 +1000
committerDave Airlie <airlied@redhat.com>2024-04-19 10:40:47 +1000
commit52c8b6e1c007b93d35058508fbe1ec80a1d9ca39 (patch)
treebba79cd5ccf4d6c75cd5ba31cce91c638890d112 /drivers/gpu/drm/xe/display/intel_fb_bo.c
parent5493bf2d0f4a1e6dcad9267bc989229d60c93e76 (diff)
parentca7c52ac7ad384bcf299d89482c45fec7cd00da9 (diff)
downloadlinux-stable-52c8b6e1c007b93d35058508fbe1ec80a1d9ca39.tar.gz
linux-stable-52c8b6e1c007b93d35058508fbe1ec80a1d9ca39.tar.bz2
linux-stable-52c8b6e1c007b93d35058508fbe1ec80a1d9ca39.zip
Merge tag 'drm-xe-fixes-2024-04-18' of https://gitlab.freedesktop.org/drm/xe/kernel into drm-fixes
- Fix bo leak on error path during fb init - Fix use-after-free due to order vm is put and destroyed Signed-off-by: Dave Airlie <airlied@redhat.com> From: Lucas De Marchi <lucas.demarchi@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/xjguifyantaibyrnymuiotxws6akiexi6r7tqyieqxgquovubc@kkrtbe24hjjr
Diffstat (limited to 'drivers/gpu/drm/xe/display/intel_fb_bo.c')
-rw-r--r--drivers/gpu/drm/xe/display/intel_fb_bo.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/gpu/drm/xe/display/intel_fb_bo.c b/drivers/gpu/drm/xe/display/intel_fb_bo.c
index b21da7b745a5..a9c1f9885c6b 100644
--- a/drivers/gpu/drm/xe/display/intel_fb_bo.c
+++ b/drivers/gpu/drm/xe/display/intel_fb_bo.c
@@ -31,7 +31,7 @@ int intel_fb_bo_framebuffer_init(struct intel_framebuffer *intel_fb,
ret = ttm_bo_reserve(&bo->ttm, true, false, NULL);
if (ret)
- return ret;
+ goto err;
if (!(bo->flags & XE_BO_SCANOUT_BIT)) {
/*
@@ -42,12 +42,16 @@ int intel_fb_bo_framebuffer_init(struct intel_framebuffer *intel_fb,
*/
if (XE_IOCTL_DBG(i915, !list_empty(&bo->ttm.base.gpuva.list))) {
ttm_bo_unreserve(&bo->ttm);
- return -EINVAL;
+ ret = -EINVAL;
+ goto err;
}
bo->flags |= XE_BO_SCANOUT_BIT;
}
ttm_bo_unreserve(&bo->ttm);
+ return 0;
+err:
+ xe_bo_put(bo);
return ret;
}