From: Michal Wajdeczko Date: Tue, 9 Apr 2024 10:51:06 +0000 (+0200) Subject: drm/xe: Check pat.ops before dumping PAT settings X-Git-Tag: v6.9.8~133 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=583ce246c7ff9edeb0de49130cdc3d45db8545cb;p=thirdparty%2Fkernel%2Fstable.git drm/xe: Check pat.ops before dumping PAT settings [ Upstream commit a918e771e6fbe1fa68932af5b0cdf473e23090cc ] We may leave pat.ops unset when running on brand new platform or when running as a VF. While the former is unlikely, the latter is valid (future) use case and will cause NPD when someone will try to dump PAT settings by debugfs. It's better to check pointer to pat.ops instead of specific .dump hook, as we have this hook always defined for every .ops variant. Signed-off-by: Michal Wajdeczko Reviewed-by: Piotr Piórkowski Link: https://patchwork.freedesktop.org/patch/msgid/20240409105106.1067-2-michal.wajdeczko@intel.com Signed-off-by: Sasha Levin --- diff --git a/drivers/gpu/drm/xe/xe_pat.c b/drivers/gpu/drm/xe/xe_pat.c index e148934d554b0..351ab902eb600 100644 --- a/drivers/gpu/drm/xe/xe_pat.c +++ b/drivers/gpu/drm/xe/xe_pat.c @@ -457,7 +457,7 @@ void xe_pat_dump(struct xe_gt *gt, struct drm_printer *p) { struct xe_device *xe = gt_to_xe(gt); - if (!xe->pat.ops->dump) + if (!xe->pat.ops) return; xe->pat.ops->dump(gt, p);