From: jsg Date: Thu, 9 Sep 2021 04:02:53 +0000 (+0000) Subject: drm/i915: Fix syncmap memory leak X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=99e610a64e136ba8bd47e00ef16192e3f0748ba0;p=openbsd drm/i915: Fix syncmap memory leak From Matthew Brost 257ea8a5edc04d5199db83137fbaa24e1de98e9e in linux 5.10.y/5.10.62 a63bcf08f0efb5348105bb8e0e1e8c6671077753 in mainline linux --- diff --git a/sys/dev/pci/drm/i915/gt/intel_timeline.c b/sys/dev/pci/drm/i915/gt/intel_timeline.c index b32cf227888..ae91f613d73 100644 --- a/sys/dev/pci/drm/i915/gt/intel_timeline.c +++ b/sys/dev/pci/drm/i915/gt/intel_timeline.c @@ -296,6 +296,14 @@ static void intel_timeline_fini(struct intel_timeline *timeline) i915_gem_object_unpin_map(timeline->hwsp_ggtt->obj); i915_vma_put(timeline->hwsp_ggtt); + + /* + * A small race exists between intel_gt_retire_requests_timeout and + * intel_timeline_exit which could result in the syncmap not getting + * free'd. Rather than work to hard to seal this race, simply cleanup + * the syncmap on fini. + */ + i915_syncmap_free(&timeline->sync); } struct intel_timeline *