From 469ad235786428214f3daf50da76f064a3818f88 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E9=BB=84=E6=B6=9B?= Date: Thu, 26 Apr 2012 16:55:13 +0800 Subject: [PATCH] ion: use list_for_each_entry_safe in ion_vma_close --- drivers/gpu/ion/ion.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/ion/ion.c b/drivers/gpu/ion/ion.c index 4053a0b35ba5..b76d61fe8921 100755 --- a/drivers/gpu/ion/ion.c +++ b/drivers/gpu/ion/ion.c @@ -809,7 +809,7 @@ static void ion_vma_close(struct vm_area_struct *vma) struct ion_handle *handle = vma->vm_private_data; struct ion_buffer *buffer = vma->vm_file->private_data; struct ion_client *client; - struct ion_user_map_addr *map = NULL; + struct ion_user_map_addr *map = NULL, *tmp; pr_debug("%s: %d\n", __func__, __LINE__); /* this indicates the client is gone, nothing to do here */ @@ -831,7 +831,7 @@ static void ion_vma_close(struct vm_area_struct *vma) atomic_read(&handle->ref.refcount), atomic_read(&buffer->ref.refcount)); mutex_lock(&buffer->lock); - list_for_each_entry(map, &buffer->map_addr, list) + list_for_each_entry_safe(map, tmp, &buffer->map_addr, list) if(map->vaddr == vma->vm_start){ list_del(&map->list); kfree(map); -- 2.34.1