]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/xe/oa: Fix static checker warning about null gt
authorAshutosh Dixit <ashutosh.dixit@intel.com>
Tue, 15 Jul 2025 18:14:22 +0000 (11:14 -0700)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Mon, 28 Jul 2025 14:22:17 +0000 (10:22 -0400)
There is a static checker warning that gt returned by xe_device_get_gt can
be NULL and that is being dereferenced. Use xe_root_mmio_gt instead, which
is equivalent and cannot return a NULL gt 0.

Fixes: 10d42ef34bce ("drm/xe/oa: Assign hwe for OAM_SAG")
Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
Reviewed-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
Link: https://lore.kernel.org/r/20250715181422.2807624-1-ashutosh.dixit@intel.com
(cherry picked from commit 308dc9b27874d0e8a0258869b9e681b0fdd2e579)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
drivers/gpu/drm/xe/xe_oa.c

index d991fbd90f2017f7b68e115215cdd423de1e1e17..5729e7d3e33569c50a12f85222ac991d07e46f3f 100644 (file)
@@ -1941,7 +1941,7 @@ static int xe_oa_assign_hwe(struct xe_oa *oa, struct xe_oa_open_param *param)
 
        /* If not provided, OA unit defaults to OA unit 0 as per uapi */
        if (!param->oa_unit)
-               param->oa_unit = &xe_device_get_gt(oa->xe, 0)->oa.oa_unit[0];
+               param->oa_unit = &xe_root_mmio_gt(oa->xe)->oa.oa_unit[0];
 
        /* When we have an exec_q, get hwe from the exec_q */
        if (param->exec_q) {