From patchwork Fri Dec 3 19:55:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hirokazu Honda X-Patchwork-Id: 15027 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id DBAB4BDB13 for ; Fri, 3 Dec 2021 19:55:56 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 8DBCA6084A; Fri, 3 Dec 2021 20:55:56 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="gDgFNetY"; dkim-atps=neutral Received: from mail-pf1-x431.google.com (mail-pf1-x431.google.com [IPv6:2607:f8b0:4864:20::431]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 7A33260872 for ; Fri, 3 Dec 2021 20:55:55 +0100 (CET) Received: by mail-pf1-x431.google.com with SMTP id o4so3816094pfp.13 for ; Fri, 03 Dec 2021 11:55:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=OApDSpAVIwnWpGVH4gzTtwnVfskfBHadlfdPlNwphF8=; b=gDgFNetYNWjOObkkyh1LJggT46hGDvdQLM0dE01PXpq6e3Z0jrDm18Kxzv88r/WkVh enaDlS0Oj9is65WoblO3oavUx5eHUi/97LDK6GF4Riv90DEhKETA2Q6ahtsxWfmZEY+O Tzh43St9z9JcadBjw5W0wkd9mBk2J7gT/lj/M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=OApDSpAVIwnWpGVH4gzTtwnVfskfBHadlfdPlNwphF8=; b=R4XsFZQcGL0e48zSK1/f7YP3nIy+ltMyfmYrHfoyzvi65NL+JoFBOJLrvDHZs+reF/ KPPlPr9W4dwpw+Mfk/EG6EcVgrJuAbKIMCGvHMtwW0RYEuvTPgpDsBhEGeAMcWtdbmGL +nuPUPlY50ddtiBHT9BY7w9THwV8Uj5ayfvdpEbkM4xl29Q3zCffglhRcTh7JAPvDVmH O2jcfPlgPhzsRIrQ09GKZ/rz5vzRoBvbbXYVmHqTbvMa6sCL7VXA5TZovK3XW8hTmcOH tW71jjJ/N55RuVkiMVBziBXTt1IGlpq4cDtCOzfp3eDmObb26Sq/ezJDZz2060d2iMCe Mj6g== X-Gm-Message-State: AOAM533oRAhEZD3rLwD9EInZ+up/Xi/EE7YVG/+rhFtFb9Fld/LmMjxp 7VJWV5rA4NLEqN/ksz/sYwt7apGhAkthKQ== X-Google-Smtp-Source: ABdhPJyTYtWZWmIiMXNmpfvgwUgH7D+3jauq3jq0nOZN069OPd2RDWdp7jJf4M7SoYuPTcvHBVb8DQ== X-Received: by 2002:a63:5906:: with SMTP id n6mr5936883pgb.563.1638561353637; Fri, 03 Dec 2021 11:55:53 -0800 (PST) Received: from hiroh2.tok.corp.google.com ([2401:fa00:8f:203:cd78:3a5f:d792:6177]) by smtp.gmail.com with ESMTPSA id t3sm4265891pfj.207.2021.12.03.11.55.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Dec 2021 11:55:53 -0800 (PST) From: Hirokazu Honda To: libcamera-devel@lists.libcamera.org Date: Sat, 4 Dec 2021 04:55:37 +0900 Message-Id: <20211203195539.1574621-6-hiroh@chromium.org> X-Mailer: git-send-email 2.34.1.400.ga245620fadb-goog In-Reply-To: <20211203195539.1574621-1-hiroh@chromium.org> References: <20211203195539.1574621-1-hiroh@chromium.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 5/7] ipa: raspberrypi: Contrast: Protect status_ access in Initialise() X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" This fixes the bug that status_ is accessed without acquiring mutex_ in Contrast::Initialise(). Signed-off-by: Hirokazu Honda --- src/ipa/raspberrypi/controller/rpi/contrast.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ipa/raspberrypi/controller/rpi/contrast.cpp b/src/ipa/raspberrypi/controller/rpi/contrast.cpp index 6726b4e3..be61353a 100644 --- a/src/ipa/raspberrypi/controller/rpi/contrast.cpp +++ b/src/ipa/raspberrypi/controller/rpi/contrast.cpp @@ -83,6 +83,7 @@ void Contrast::Initialise() { // Fill in some default values as Prepare will run before Process gets // called. + MutexLocker locker(mutex_); fill_in_status(status_, brightness_, contrast_, config_.gamma_curve); }