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

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

Merge "msm_vidc: Clear pendingq when releasing buffers"

parents 3f0d285c cad5db35
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -903,6 +903,7 @@ int msm_vidc_release_buffer(void *instance, int buffer_type,
	struct buffer_info *bi, *dummy;
	int i, rc = 0;
	int found_buf = 0;
	struct vb2_buf_entry *temp, *next;

	if (!inst)
		return -EINVAL;
@@ -961,6 +962,16 @@ int msm_vidc_release_buffer(void *instance, int buffer_type,
	default:
		break;
	}

	mutex_lock(&inst->pendingq.lock);
	list_for_each_entry_safe(temp, next, &inst->pendingq.list, list) {
		if (temp->vb->type == buffer_type) {
			list_del(&temp->list);
			kfree(temp);
		}
	}
	mutex_unlock(&inst->pendingq.lock);

	return rc;
}
EXPORT_SYMBOL(msm_vidc_release_buffer);