Skip to contentSkip to conversation

drm/ttm/tests: fix incorrect assert in ttm_bo_unreserve_bulk()

PATCH In review Qasim Ijaz 2 participants 2 messages Mar 13, 2025 – Mar 14, 2025

Subsystems (3)
lore
Share & tools
lore

Qasim Ijaz

author
#0 lore raw

PATCH 1/1 drm/ttm/tests: fix incorrect assert in ttm_bo_unreserve_bulk()

In the ttm_bo_unreserve_bulk() test function, resv is allocated using kunit_kzalloc(), but the subsequent assertion mistakenly verifies the ttm_dev pointer instead of the resv pointer.

Fix the assertion to properly verify the resv pointer.

---
 drivers/gpu/drm/ttm/tests/ttm_bo_test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/ttm/tests/ttm_bo_test.c +1 -1
index f8f20d2f6174..e08e5a138420 100644
@@ -340,7 +340,7 @@ static void ttm_bo_unreserve_bulk(struct kunit *test)
 	KUNIT_ASSERT_NOT_NULL(test, ttm_dev);
 
 	resv = kunit_kzalloc(test, sizeof(*resv), GFP_KERNEL);
-	KUNIT_ASSERT_NOT_NULL(test, ttm_dev);
+	KUNIT_ASSERT_NOT_NULL(test, resv);
 
 	err = ttm_device_kunit_init(priv, ttm_dev, false, false);
 	KUNIT_ASSERT_EQ(test, err, 0);
Signature · 1 line
2.39.5
#1 lore raw

Am 13.03.25 um 17:14 schrieb Qasim Ijaz:

Quoted 7 lines

In the ttm_bo_unreserve_bulk() test function, resv is allocated using kunit_kzalloc(), but the subsequent assertion mistakenly verifies the ttm_dev pointer instead of the resv pointer.

Fix the assertion to properly verify the resv pointer.

Reviewed and pushed.

Thanks,
Christian.

Quoted 17 lines
---
 drivers/gpu/drm/ttm/tests/ttm_bo_test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/ttm/tests/ttm_bo_test.c +1 -1
index f8f20d2f6174..e08e5a138420 100644
@@ -340,7 +340,7 @@ static void ttm_bo_unreserve_bulk(struct kunit *test)
 	KUNIT_ASSERT_NOT_NULL(test, ttm_dev);
 
 	resv = kunit_kzalloc(test, sizeof(*resv), GFP_KERNEL);
-	KUNIT_ASSERT_NOT_NULL(test, ttm_dev);
+	KUNIT_ASSERT_NOT_NULL(test, resv);
 
 	err = ttm_device_kunit_init(priv, ttm_dev, false, false);
 	KUNIT_ASSERT_EQ(test, err, 0);