i915/perf: Fix NULL deref bugs with drm_dbg() calls
authorHarshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Fri, 27 Oct 2023 17:28:22 +0000 (10:28 -0700)
committerTvrtko Ursulin <tvrtko.ursulin@intel.com>
Mon, 30 Oct 2023 11:00:03 +0000 (11:00 +0000)
commit36f27350ff745bd228ab04d7845dfbffc177a889
treec6a48323164fbf14ff4b27c5349ec897c6e3fef4
parent33f2af42a2019da4fecde30fe144a810b485762f
i915/perf: Fix NULL deref bugs with drm_dbg() calls

When i915 perf interface is not available dereferencing it will lead to
NULL dereferences.

As returning -ENOTSUPP is pretty clear return when perf interface is not
available.

Fixes: 2fec539112e8 ("i915/perf: Replace DRM_DEBUG with driver specific drm_dbg call")
Suggested-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: <stable@vger.kernel.org> # v6.0+
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231027172822.2753059-1-harshit.m.mogalapalli@oracle.com
[tursulin: added stable tag]
drivers/gpu/drm/i915/i915_perf.c