On Mon, Nov 21, 2011 at 01:05:02PM +0100, Thomas Hellstrom wrote: > An unlikely race could case a bo to be returned reserved on an error path. > > Signed-off-by: Thomas Hellstrom <thellstrom@xxxxxxxxxx> Reviewed-by: Jerome Glisse <jglisse@xxxxxxxxxx> > --- > drivers/gpu/drm/ttm/ttm_bo.c | 8 +++++++- > 1 files changed, 7 insertions(+), 1 deletions(-) > > diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c > index 617b646..0bb0f5f 100644 > --- a/drivers/gpu/drm/ttm/ttm_bo.c > +++ b/drivers/gpu/drm/ttm/ttm_bo.c > @@ -574,10 +574,16 @@ retry: > return ret; > > spin_lock(&glob->lru_lock); > + > + if (unlikely(list_empty(&bo->ddestroy))) { > + spin_unlock(&glob->lru_lock); > + return 0; > + } > + > ret = ttm_bo_reserve_locked(bo, interruptible, > no_wait_reserve, false, 0); > > - if (unlikely(ret != 0) || list_empty(&bo->ddestroy)) { > + if (unlikely(ret != 0)) { > spin_unlock(&glob->lru_lock); > return ret; > } > -- > 1.7.4.4 > > _______________________________________________ > dri-devel mailing list > dri-devel@xxxxxxxxxxxxxxxxxxxxx > http://lists.freedesktop.org/mailman/listinfo/dri-devel _______________________________________________ dri-devel mailing list dri-devel@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/dri-devel