]> git.baikalelectronics.ru Git - kernel.git/commit
ttm: don't destroy old mm_node on memcpy failure
authorDave Airlie <airlied@gmail.com>
Wed, 16 Jan 2013 04:25:44 +0000 (14:25 +1000)
committerDave Airlie <airlied@redhat.com>
Mon, 21 Jan 2013 03:45:02 +0000 (13:45 +1000)
commitbe555c0b4531d0afb0dd375a85cf30de6f751169
treeb15977d12080c0090d8918d48f2d3a6bba9085c4
parent2c6c5dffd9d0deb76a6d6ebb20691d5d41dc8806
ttm: don't destroy old mm_node on memcpy failure

When we are using memcpy to move objects around, and we fail to memcpy
due to lack of memory to populate or failure to finish the copy, we don't
want to destroy the mm_node that has been copied into old_copy.

While working on a new kms driver that uses memcpy, if I overallocated bo's
up to the memory limits, and eviction failed, then machine would oops soon
after due to having an active bo with an already freed drm_mm embedded in it,
freeing it a second time didn't end well.

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/ttm/ttm_bo_util.c