From patchwork Tue Apr 5 13:50:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Zabel X-Patchwork-Id: 556396 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6D0E3C35276 for ; Tue, 5 Apr 2022 23:02:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1454777AbiDEWwR (ORCPT ); Tue, 5 Apr 2022 18:52:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1442049AbiDEPgz (ORCPT ); Tue, 5 Apr 2022 11:36:55 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D54C1A8EC2 for ; Tue, 5 Apr 2022 06:50:43 -0700 (PDT) Received: from dude03.red.stw.pengutronix.de ([2a0a:edc0:0:1101:1d::39]) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1nbjZx-0002jS-La; Tue, 05 Apr 2022 15:50:41 +0200 From: Philipp Zabel To: linux-media@vger.kernel.org Cc: Mauro Carvalho Chehab , kernel@pengutronix.de Subject: [PATCH] media: coda: assert bitstream mutex is locked in coda_fill_bitstream Date: Tue, 5 Apr 2022 15:50:35 +0200 Message-Id: <20220405135035.3428144-1-p.zabel@pengutronix.de> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a0a:edc0:0:1101:1d::39 X-SA-Exim-Mail-From: p.zabel@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org coda_fill_bitstream() must be called under the bitstream mutex. Signed-off-by: Philipp Zabel --- drivers/media/platform/chips-media/coda-bit.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/media/platform/chips-media/coda-bit.c b/drivers/media/platform/chips-media/coda-bit.c index 705a179ea8f0..3aad8999a3b3 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;