Skip to content

Commit 616576d

Browse files
Dan CarpenterThomas Hellström
authored andcommitted
drm/xe/selftests: Fix an error pointer dereference bug
Check if "bo" is an error pointer before calling xe_bo_lock() on it. Fixes: d6abc18 ("drm/xe/xe2: Modify xe_bo_test for system memory") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Signed-off-by: Matthew Brost <matthew.brost@intel.com> Reviewed-by: Matthew Brost <matthew.brost@intel.com> (cherry picked from commit 88ec235) Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
1 parent ffd915e commit 616576d

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/gpu/drm/xe/tests/xe_bo.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,14 +125,13 @@ static void ccs_test_run_tile(struct xe_device *xe, struct xe_tile *tile,
125125

126126
bo = xe_bo_create_user(xe, NULL, NULL, SZ_1M, DRM_XE_GEM_CPU_CACHING_WC,
127127
ttm_bo_type_device, bo_flags);
128-
129-
xe_bo_lock(bo, false);
130-
131128
if (IS_ERR(bo)) {
132129
KUNIT_FAIL(test, "Failed to create bo.\n");
133130
return;
134131
}
135132

133+
xe_bo_lock(bo, false);
134+
136135
kunit_info(test, "Verifying that CCS data is cleared on creation.\n");
137136
ret = ccs_test_migrate(tile, bo, false, 0ULL, 0xdeadbeefdeadbeefULL,
138137
test);

0 commit comments

Comments
 (0)