summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/xe/xe_pt.c
diff options
context:
space:
mode:
authorLucas De Marchi <lucas.demarchi@intel.com>2023-07-26 19:07:01 +0300
committerRodrigo Vivi <rodrigo.vivi@intel.com>2023-12-21 19:38:30 +0300
commit0e34fdb4a01a3e615c109694b5adc53590ccda19 (patch)
tree36d92fe953be27246d7fa6f3ea7768483c45610d /drivers/gpu/drm/xe/xe_pt.c
parent6aa26f6eb829fb208c569b92837a13e889891db4 (diff)
downloadlinux-0e34fdb4a01a3e615c109694b5adc53590ccda19.tar.xz
drm/xe: Fix checking for unset value
Commit 37430402618d ("drm/xe: NULL binding implementation") introduced the NULL binding implementation, but left a case in which the out value is_vram is not set and the caller will use whatever was on stack. Eventually the is_vram out could be removed, but this should at least fix the current bug. Fixes: 37430402618d ("drm/xe: NULL binding implementation") Reviewed-by: Matt Roper <matthew.d.roper@intel.com> Link: https://lore.kernel.org/r/20230726160708.3967790-4-lucas.demarchi@intel.com Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Diffstat (limited to 'drivers/gpu/drm/xe/xe_pt.c')
-rw-r--r--drivers/gpu/drm/xe/xe_pt.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gpu/drm/xe/xe_pt.c b/drivers/gpu/drm/xe/xe_pt.c
index 8b75a6145f9b..612de787c19e 100644
--- a/drivers/gpu/drm/xe/xe_pt.c
+++ b/drivers/gpu/drm/xe/xe_pt.c
@@ -81,8 +81,10 @@ u64 xe_pde_encode(struct xe_bo *bo, u64 bo_offset,
static dma_addr_t vma_addr(struct xe_vma *vma, u64 offset,
size_t page_size, bool *is_vram)
{
- if (xe_vma_is_null(vma))
+ if (xe_vma_is_null(vma)) {
+ *is_vram = 0;
return 0;
+ }
if (xe_vma_is_userptr(vma)) {
struct xe_res_cursor cur;