[libcamera-devel,5/7] ipa: raspberrypi: Contrast: Protect status_ access in Initialise()
diff mbox series

Message ID 20211203195539.1574621-6-hiroh@chromium.org
State New
Headers show
Series
  • Apply clang thread safety annotations to raspberrypi
Related show

Commit Message

Hirokazu Honda Dec. 3, 2021, 7:55 p.m. UTC
This fixes the bug that status_ is accessed without acquiring
mutex_ in Contrast::Initialise().

Signed-off-by: Hirokazu Honda <hiroh@chromium.org>
---
 src/ipa/raspberrypi/controller/rpi/contrast.cpp | 1 +
 1 file changed, 1 insertion(+)

Patch
diff mbox series

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);
 }