]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915/pmu: Avoid using globals for PMU events
authorMichał Winiarski <michal.winiarski@intel.com>
Wed, 19 Feb 2020 16:18:22 +0000 (17:18 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Fri, 21 Feb 2020 17:31:15 +0000 (17:31 +0000)
commit46129dc10f47c5c2b51c93a82b7b2aca46574ae0
tree36d042582b02d6b084b899b2966b9518c60e8d92
parentf5a179d4687d4e7bfadd7cbda7ee5d0bad76761f
drm/i915/pmu: Avoid using globals for PMU events

Attempting to bind / unbind module from devices where we have both
integrated and discreete GPU handled by i915, will cause us to try and
double free the global state, hitting null ptr deref in free_event_attributes.

Let's move it to i915_pmu.

Fixes: 05488673a4d4 ("drm/i915/pmu: Support multiple GPUs")
Signed-off-by: Michał Winiarski <michal.winiarski@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20200219161822.24592-2-michal.winiarski@intel.com
drivers/gpu/drm/i915/i915_pmu.c
drivers/gpu/drm/i915/i915_pmu.h