drm/i915: Fix memleak in runtime wakeref tracking
authorMika Kuoppala <mika.kuoppala@linux.intel.com>
Mon, 1 Jul 2019 10:44:42 +0000 (13:44 +0300)
committerJani Nikula <jani.nikula@intel.com>
Mon, 29 Jul 2019 12:32:59 +0000 (15:32 +0300)
commitfdcc789a4a0bb2ef01857095752be12b03cbb341
treed1f886920ab3de80d066985bd60f4598531dc91e
parentcf8f9aa1eda7d916bd23f6b8c226404deb11690c
drm/i915: Fix memleak in runtime wakeref tracking

If we untrack wakerefs, the actual count may reach zero.
However the krealloced owners array is still there and
needs to be taken care of. Free the owners unconditionally
to fix the leak.

Fixes: bd780f37a361 ("drm/i915: Track all held rpm wakerefs")
Reported-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Cc: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Mika Kuoppala <mika.kuoppala@linux.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/20190701104442.9319-1-mika.kuoppala@linux.intel.com
(cherry picked from commit c5f846eed2a1856b78e988eeef08215c70598ecd)
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/i915/intel_runtime_pm.c