diff options
author | Luca Barbieri <luca@luca-barbieri.com> | 2010-01-20 20:01:30 +0100 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-01-25 11:43:54 +1000 |
commit | 1a961ce09fe39df9a1b796df98794fd32c76c413 (patch) | |
tree | 06ab04dd5f4fb780f23a8468cf2b65d152c3db1f /drivers/gpu/drm/i915/i915_gem.c | |
parent | 8471a26b9c36c965d278020cc0699e2e95d120e5 (diff) |
drm/ttm: Fix race condition in ttm_bo_delayed_delete (v3, final)
Resending this with Thomas Hellstrom's signoff for merging into 2.6.33
ttm_bo_delayed_delete has a race condition, because after we do:
kref_put(&nentry->list_kref, ttm_bo_release_list);
we are not holding the list lock and not holding any reference to
objects, and thus every bo in the list can be removed and freed at
this point.
However, we then use the next pointer we stored, which is not guaranteed
to be valid.
This was apparently the cause of some Nouveau oopses I experienced.
This patch rewrites the function so that it keeps the reference to nentry
until nentry itself is freed and we already got a reference to nentry->next.
v2 updated by me according to Thomas Hellstrom's feedback.
v3 proposed by Thomas Hellstrom. Commit comment updated by me.
Both updates fixed minor efficiency/style issues only and all three versions
should be correct.
Signed-off-by: Luca Barbieri <luca@luca-barbieri.com>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem.c')
0 files changed, 0 insertions, 0 deletions