]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915/gtt: Handle double alloc failures
authorChris Wilson <chris@chris-wilson.co.uk>
Thu, 4 Jul 2019 10:43:45 +0000 (11:43 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Thu, 4 Jul 2019 15:04:21 +0000 (16:04 +0100)
commit3f80f1dffb49359c571fea7950b750d5552dbf27
tree59afeac4fcfbc1d85955fad0438ef33f7b721fc8
parent6d1d513d4706f220a961f043007bc32b8c3252c0
drm/i915/gtt: Handle double alloc failures

Matthew pointed out that we could face a double failure with concurrent
allocations/frees, and so the assumption that the local var alloc was
NULL was fraught with danger. Rather than complicate the error paths too
much to add a second local for a second free, just do the second free
earlier on the unwind path.

Reported-by: Matthew Auld <matthew.william.auld@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Matthew Auld <matthew.william.auld@gmail.com>
Reviewed-by: Matthew Auld <matthew.william.auld@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190704104345.6603-1-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/i915_gem_gtt.c