Patch "drm/xe: fix the ERR_PTR() returned on failure to allocate tiny pt" has been added to the 6.12-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    drm/xe: fix the ERR_PTR() returned on failure to allocate tiny pt

to the 6.12-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     drm-xe-fix-the-err_ptr-returned-on-failure-to-alloca.patch
and it can be found in the queue-6.12 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 62695e172bf8557a25888a38fe770a70b08e6fac
Author: Mirsad Todorovac <mtodorovac69@xxxxxxxxx>
Date:   Thu Nov 21 22:20:58 2024 +0100

    drm/xe: fix the ERR_PTR() returned on failure to allocate tiny pt
    
    [ Upstream commit ed69b28b3a5e39871ba5599992f80562d6ee59db ]
    
    Running coccinelle spatch gave the following warning:
    
    ./drivers/gpu/drm/xe/tests/xe_migrate.c:226:5-11: inconsistent IS_ERR
    and PTR_ERR on line 228.
    
    The code reports PTR_ERR(pt) when IS_ERR(tiny) is checked:
    
    → 211  pt = xe_bo_create_pin_map(xe, tile, m->q->vm, XE_PAGE_SIZE,
      212                            ttm_bo_type_kernel,
      213                            XE_BO_FLAG_VRAM_IF_DGFX(tile) |
      214                            XE_BO_FLAG_PINNED);
      215  if (IS_ERR(pt)) {
      216          KUNIT_FAIL(test, "Failed to allocate fake pt: %li\n",
      217                     PTR_ERR(pt));
      218          goto free_big;
      219  }
      220
      221  tiny = xe_bo_create_pin_map(xe, tile, m->q->vm,
    → 222                              2 * SZ_4K,
      223                              ttm_bo_type_kernel,
      224                              XE_BO_FLAG_VRAM_IF_DGFX(tile) |
      225                              XE_BO_FLAG_PINNED);
    → 226  if (IS_ERR(tiny)) {
    → 227          KUNIT_FAIL(test, "Failed to allocate fake pt: %li\n",
    → 228                     PTR_ERR(pt));
      229          goto free_pt;
      230  }
    
    Now, the IS_ERR(tiny) and the corresponding PTR_ERR(pt) do not match.
    
    Returning PTR_ERR(tiny), as the last failed function call, seems logical.
    
    Fixes: dd08ebf6c352 ("drm/xe: Introduce a new DRM driver for Intel GPUs")
    Signed-off-by: Mirsad Todorovac <mtodorovac69@xxxxxxxxx>
    Link: https://patchwork.freedesktop.org/patch/msgid/20241121212057.1526634-2-mtodorovac69@xxxxxxxxx
    Signed-off-by: Rodrigo Vivi <rodrigo.vivi@xxxxxxxxx>
    (cherry picked from commit cb57c75098c1c449a007ba301f9073f96febaaa9)
    Signed-off-by: Thomas Hellström <thomas.hellstrom@xxxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/gpu/drm/xe/tests/xe_migrate.c b/drivers/gpu/drm/xe/tests/xe_migrate.c
index 1a192a2a941b..3bbdb362d6f0 100644
--- a/drivers/gpu/drm/xe/tests/xe_migrate.c
+++ b/drivers/gpu/drm/xe/tests/xe_migrate.c
@@ -224,8 +224,8 @@ static void xe_migrate_sanity_test(struct xe_migrate *m, struct kunit *test)
 				    XE_BO_FLAG_VRAM_IF_DGFX(tile) |
 				    XE_BO_FLAG_PINNED);
 	if (IS_ERR(tiny)) {
-		KUNIT_FAIL(test, "Failed to allocate fake pt: %li\n",
-			   PTR_ERR(pt));
+		KUNIT_FAIL(test, "Failed to allocate tiny fake pt: %li\n",
+			   PTR_ERR(tiny));
 		goto free_pt;
 	}
 




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux