From: Philipp Zabel Date: Fri, 23 Jan 2015 16:51:32 +0000 (-0300) Subject: [media] coda: free context buffers under buffer mutex X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=540d70d577dc3c78590f480c832e85ac28e5482a;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git [media] coda: free context buffers under buffer mutex Make sure the buffer_mutex lock is taken in coda_bit_release while coda_free_framebuffers and coda_free_context_buffers are called. Signed-off-by: Philipp Zabel Signed-off-by: Kamil Debski Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/platform/coda/coda-bit.c b/drivers/media/platform/coda/coda-bit.c index 7cdddd55d65d..856b542b35b9 100644 --- a/drivers/media/platform/coda/coda-bit.c +++ b/drivers/media/platform/coda/coda-bit.c @@ -1319,8 +1319,10 @@ static void coda_seq_end_work(struct work_struct *work) static void coda_bit_release(struct coda_ctx *ctx) { + mutex_lock(&ctx->buffer_mutex); coda_free_framebuffers(ctx); coda_free_context_buffers(ctx); + mutex_unlock(&ctx->buffer_mutex); } const struct coda_context_ops coda_bit_encode_ops = {