]> git.proxmox.com Git - mirror_ubuntu-hirsute-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)
committerJani Nikula <jani.nikula@intel.com>
Wed, 26 Feb 2020 12:07:50 +0000 (14:07 +0200)
commit2de0147d77168d6a227c00eb9c5a49374e1582a3
tree7db3d34aa0d208c292d701ccaf4f0ff8b63cdf34
parent19ee5e8da6129d8d828201a12264ab3d09153ec4
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
(cherry picked from commit 46129dc10f47c5c2b51c93a82b7b2aca46574ae0)
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/i915/i915_pmu.c
drivers/gpu/drm/i915/i915_pmu.h