From: Philipp Zabel 
Date: Tue, 5 Apr 2022 13:50:35 +0000 (+0100)
Subject: media: coda: assert bitstream mutex is locked in coda_fill_bitstream
X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=87e0ce68cc0216063c6329aca0c31961a33a5372;p=users%2Fhch%2Fblock.git
media: coda: assert bitstream mutex is locked in coda_fill_bitstream
coda_fill_bitstream() must be called under the bitstream mutex.
Signed-off-by: Philipp Zabel 
Signed-off-by: Hans Verkuil 
Signed-off-by: Mauro Carvalho Chehab 
---
diff --git a/drivers/media/platform/chips-media/coda-bit.c b/drivers/media/platform/chips-media/coda-bit.c
index c484c008ab02..804fc84d5966 100644
--- a/drivers/media/platform/chips-media/coda-bit.c
+++ b/drivers/media/platform/chips-media/coda-bit.c
@@ -326,6 +326,8 @@ void coda_fill_bitstream(struct coda_ctx *ctx, struct list_head *buffer_list)
 	struct coda_buffer_meta *meta;
 	u32 start;
 
+	lockdep_assert_held(&ctx->bitstream_mutex);
+
 	if (ctx->bit_stream_param & CODA_BIT_STREAM_END_FLAG)
 		return;