From: 黄涛 Date: Thu, 26 Apr 2012 08:55:13 +0000 (+0800) Subject: ion: use list_for_each_entry_safe in ion_vma_close X-Git-Tag: firefly_0821_release~9296 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=469ad235786428214f3daf50da76f064a3818f88;p=firefly-linux-kernel-4.4.55.git ion: use list_for_each_entry_safe in ion_vma_close --- 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);