[PATCH 1/2] drm/ttm: fix return value check

Christian König ckoenig.leichtzumerken at gmail.com
Fri Apr 9 13:01:12 UTC 2021


The function returns the number of swapped pages here. Only abort when we get
a negative error code.

Signed-off-by: Christian König <christian.koenig at amd.com>
---
 drivers/gpu/drm/ttm/ttm_tt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c
index 7dcd3fb69495..7d479095dcf8 100644
--- a/drivers/gpu/drm/ttm/ttm_tt.c
+++ b/drivers/gpu/drm/ttm/ttm_tt.c
@@ -326,7 +326,7 @@ int ttm_tt_populate(struct ttm_device *bdev,
 	       ttm_dma32_pages_limit) {
 
 		ret = ttm_global_swapout(ctx, GFP_KERNEL);
-		if (ret)
+		if (ret < 0)
 			goto error;
 	}
 
-- 
2.25.1



More information about the dri-devel mailing list