Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fc873583 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: kgsl: The memory entry pending flag should be guarded"

parents 0b3f3760 67b5333b
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -965,9 +965,10 @@ static int kgsl_release(struct inode *inodep, struct file *filep)
	while (1) {
		spin_lock(&private->mem_lock);
		entry = idr_get_next(&private->mem_idr, &next);
		if (entry == NULL) {
			spin_unlock(&private->mem_lock);
		if (entry == NULL)
			break;
		}
		/*
		 * If the free pending flag is not set it means that user space
		 * did not free it's reference to this entry, in that case
@@ -976,7 +977,10 @@ static int kgsl_release(struct inode *inodep, struct file *filep)
		 */
		if (entry->dev_priv == dev_priv && !entry->pending_free) {
			entry->pending_free = 1;
			spin_unlock(&private->mem_lock);
			kgsl_mem_entry_put(entry);
		} else {
			spin_unlock(&private->mem_lock);
		}
		next = next + 1;
	}