Commit fb26eee0 authored by Tvrtko Ursulin's avatar Tvrtko Ursulin

drm/i915/pmu: Fix uninitialized variable on error path

If name allocation failed the log message will contain an uninitialized
error code which can be confusing.

Fixes: 05488673 ("drm/i915/pmu: Support multiple GPUs")
Signed-off-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20191018090514.1818-1-tvrtko.ursulin@linux.intel.com
[tursulin: Commit message spelling fix.]
parent 5d904e3c
......@@ -1094,7 +1094,7 @@ static bool is_igp(struct drm_i915_private *i915)
void i915_pmu_register(struct drm_i915_private *i915)
{
struct i915_pmu *pmu = &i915->pmu;
int ret;
int ret = -ENOMEM;
if (INTEL_GEN(i915) <= 2) {
dev_info(i915->drm.dev, "PMU not supported for this GPU.");
......@@ -1102,10 +1102,8 @@ void i915_pmu_register(struct drm_i915_private *i915)
}
i915_pmu_events_attr_group.attrs = create_event_attributes(pmu);
if (!i915_pmu_events_attr_group.attrs) {
ret = -ENOMEM;
if (!i915_pmu_events_attr_group.attrs)
goto err;
}
pmu->base.attr_groups = i915_pmu_attr_groups;
pmu->base.task_ctx_nr = perf_invalid_context;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment