From 5fe1ba867adc397bfb33ce091c773ff31519510a Mon Sep 17 00:00:00 2001
From: Adrian Gielniewski <adrian.gielniewski@nordicsemi.no>
Date: Mon, 3 Mar 2025 20:30:00 +0100
Subject: [PATCH] Fix clang-tidy error in PersistedCounter.h

Signed-off-by: Adrian Gielniewski <adrian.gielniewski@nordicsemi.no>
---
 src/lib/support/PersistedCounter.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/lib/support/PersistedCounter.h b/src/lib/support/PersistedCounter.h
index 24640d24057f20..77edfdeed2157e 100644
--- a/src/lib/support/PersistedCounter.h
+++ b/src/lib/support/PersistedCounter.h
@@ -229,6 +229,11 @@ class PersistedCounter : public MonotonicallyIncreasingCounter<T>
         T valueLE     = GetInitialCounterValue();
         uint16_t size = sizeof(valueLE);
 
+        // clang-tidy claims that we're returning without writing to 'aStartValue',
+        // assign 0 to supppress the warning. In case of error, the value wont't be
+        // used anyway.
+        aStartValue = 0;
+
         VerifyOrReturnError(mKey.IsInitialized(), CHIP_ERROR_INCORRECT_STATE);
 
         CHIP_ERROR err = mStorage->SyncGetKeyValue(mKey.KeyName(), &valueLE, size);