diff options
author | Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com> | 2023-03-24 01:58:55 +0300 |
---|---|---|
committer | Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com> | 2023-03-24 18:49:22 +0300 |
commit | 772a5803922a097eaf94cf865c6f4a81416aedb8 (patch) | |
tree | 31601489a15c9a2c951b3e79a83ee4a03c1b2f98 /drivers/gpu/drm/i915/i915_perf.c | |
parent | 5f284e9c5aab5b12eb48a2cecc7a573c3b4e1cb4 (diff) | |
download | linux-772a5803922a097eaf94cf865c6f4a81416aedb8.tar.xz |
drm/i915/perf: Fail modprobe if i915_perf_init fails on OOM
i915_perf_init can fail due to OOM. Fail driver init if i915_perf_init
fails.
v2: (Jani)
- Reorder patch in the series
Signed-off-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230323225901.3743681-6-umesh.nerlige.ramappa@intel.com
Diffstat (limited to 'drivers/gpu/drm/i915/i915_perf.c')
-rw-r--r-- | drivers/gpu/drm/i915/i915_perf.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/i915_perf.c b/drivers/gpu/drm/i915/i915_perf.c index cf4ea5e389a5..584e3e7b9e77 100644 --- a/drivers/gpu/drm/i915/i915_perf.c +++ b/drivers/gpu/drm/i915/i915_perf.c @@ -4902,7 +4902,7 @@ static void i915_perf_init_info(struct drm_i915_private *i915) * Note: i915-perf initialization is split into an 'init' and 'register' * phase with the i915_perf_register() exposing state to userspace. */ -void i915_perf_init(struct drm_i915_private *i915) +int i915_perf_init(struct drm_i915_private *i915) { struct i915_perf *perf = &i915->perf; @@ -5018,12 +5018,16 @@ void i915_perf_init(struct drm_i915_private *i915) perf->i915 = i915; ret = oa_init_engine_groups(perf); - if (ret) + if (ret) { drm_err(&i915->drm, "OA initialization failed %d\n", ret); + return ret; + } oa_init_supported_formats(perf); } + + return 0; } static int destroy_config(int id, void *p, void *data) |