Skip to content

Commit 6aaceed

Browse files
ashutoshxrodrigovivi
authored andcommitted
drm/xe/oa: Fix static checker warning about null gt
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: 10d42ef ("drm/xe/oa: Assign hwe for OAM_SAG") Signed-off-by: Ashutosh Dixit <[email protected]> Reviewed-by: Umesh Nerlige Ramappa <[email protected]> Link: https://lore.kernel.org/r/[email protected] (cherry picked from commit 308dc9b27874d0e8a0258869b9e681b0fdd2e579) Signed-off-by: Rodrigo Vivi <[email protected]>
1 parent d9e9aa3 commit 6aaceed

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpu/drm/xe/xe_oa.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1941,7 +1941,7 @@ static int xe_oa_assign_hwe(struct xe_oa *oa, struct xe_oa_open_param *param)
19411941

19421942
/* If not provided, OA unit defaults to OA unit 0 as per uapi */
19431943
if (!param->oa_unit)
1944-
param->oa_unit = &xe_device_get_gt(oa->xe, 0)->oa.oa_unit[0];
1944+
param->oa_unit = &xe_root_mmio_gt(oa->xe)->oa.oa_unit[0];
19451945

19461946
/* When we have an exec_q, get hwe from the exec_q */
19471947
if (param->exec_q) {

0 commit comments

Comments
 (0)