]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
soc: samsung: exynos-pmu: Fix uninitialized ret in tensor_set_bits_atomic()
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Sat, 4 Jan 2025 13:56:05 +0000 (14:56 +0100)
committerKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Mon, 6 Jan 2025 09:54:04 +0000 (10:54 +0100)
If tensor_set_bits_atomic() is called with a mask of 0 the function will
just iterate over its bit, not perform any updates and return stack
value of 'ret'.

Also reported by smatch:

  drivers/soc/samsung/exynos-pmu.c:129 tensor_set_bits_atomic() error: uninitialized symbol 'ret'.

Fixes: 0b7c6075022c ("soc: samsung: exynos-pmu: Add regmap support for SoCs that protect PMU regs")
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20250104135605.109209-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
drivers/soc/samsung/exynos-pmu.c

index d8c53cec7f37ad592b6ac3940820dd75a13130bf..dd5256e5aae1ae934aeb36725161a1556e9a712a 100644 (file)
@@ -126,7 +126,7 @@ static int tensor_set_bits_atomic(void *ctx, unsigned int offset, u32 val,
                if (ret)
                        return ret;
        }
-       return ret;
+       return 0;
 }
 
 static bool tensor_is_atomic(unsigned int reg)