Commit 84fefb5d authored by Jani Nikula's avatar Jani Nikula Committed by Jeff Johnson
Browse files

drm/i915/panic: fix panic structure allocation memory leak



Separating the panic allocation from framebuffer allocation in commit
729c5f7f ("drm/{i915,xe}/panic: move framebuffer allocation where it
belongs") failed to deallocate the panic structure anywhere.

The fix is two-fold. First, free the panic structure in
intel_user_framebuffer_destroy() in the general case. Second, move the
panic allocation later to intel_framebuffer_init() to not leak the panic
structure in error paths (if any, now or later) between
intel_framebuffer_alloc() and intel_framebuffer_init().

v2: Rebase

Fixes: 729c5f7f ("drm/{i915,xe}/panic: move framebuffer allocation where it belongs")
Cc: Jocelyn Falempe <jfalempe@redhat.com>
Cc: Maarten Lankhorst <dev@lankhorst.se>
Reported-by: default avatarMichał Grzelak <michal.grzelak@intel.com>
Suggested-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Tested-by: Michał Grzelak <michal.grzelak@intel.com> # v1
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Reviewed-by: default avatarJocelyn Falempe <jfalempe@redhat.com>
Signed-off-by: default avatarJeff Johnson <jeff.johnson@oss.qualcomm.com>
(cherry picked from commit 421a2cf3fa1531b9fe016f853db50bd83375712c)
parent d7f85c68
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment