From: Jerome Glisse Subject: Re: [PATCH] drm/radeon/kms/vm: fix possible bug in radeon_vm_bo_rmv() Date: Wed, 29 Feb 2012 12:45:07 -0500 Message-ID: <1330537507.2535.0.camel@localhost.localdomain> References: <1330531492-22752-1-git-send-email-alexdeucher@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-pz0-f53.google.com (mail-pz0-f53.google.com [209.85.210.53]) by gabe.freedesktop.org (Postfix) with ESMTP id 83FD79E81A for ; Wed, 29 Feb 2012 09:45:11 -0800 (PST) Received: by dady25 with SMTP id y25so1177988dad.26 for ; Wed, 29 Feb 2012 09:45:11 -0800 (PST) In-Reply-To: <1330531492-22752-1-git-send-email-alexdeucher@gmail.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: alexdeucher@gmail.com Cc: Alex Deucher , Sebastian Biemueller , dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org On Wed, 2012-02-29 at 11:04 -0500, alexdeucher@gmail.com wrote: > From: Sebastian Biemueller > > The bo is removed from the list at the top of > radeon_vm_bo_rmv(), but then the list is used > in radeon_vm_bo_update_pte() to look up the vm. > remove the bo_list entry at the end of the > function instead. > > Signed-off-by: Alex Deucher > Cc: Jerome Glisse Reviewed-by: Jerome Glisse > --- > drivers/gpu/drm/radeon/radeon_gart.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/drivers/gpu/drm/radeon/radeon_gart.c b/drivers/gpu/drm/radeon/radeon_gart.c > index 010dad8..c58a036 100644 > --- a/drivers/gpu/drm/radeon/radeon_gart.c > +++ b/drivers/gpu/drm/radeon/radeon_gart.c > @@ -597,13 +597,13 @@ int radeon_vm_bo_rmv(struct radeon_device *rdev, > if (bo_va == NULL) > return 0; > > - list_del(&bo_va->bo_list); > mutex_lock(&vm->mutex); > radeon_mutex_lock(&rdev->cs_mutex); > radeon_vm_bo_update_pte(rdev, vm, bo, NULL); > radeon_mutex_unlock(&rdev->cs_mutex); > list_del(&bo_va->vm_list); > mutex_unlock(&vm->mutex); > + list_del(&bo_va->bo_list); > > kfree(bo_va); > return 0;