clk: exynos: Fix always true test
authorAndrew Goodbody <andrew.goodbody@linaro.org>
Wed, 23 Jul 2025 16:04:41 +0000 (17:04 +0100)
committerMinkyu Kang <mk7.kang@samsung.com>
Mon, 1 Sep 2025 07:37:08 +0000 (16:37 +0900)
commitc901732558fbee5b798bb7a065f7832d3a6bbc84
tree16c2067dd66fb923a3bb6fa25636a92dd45eecd3
parent3dc5e9a0108bb114175b6362f9cb22367402f624
clk: exynos: Fix always true test

In exynos7420_peric1_get_rate the variable ret is declared as an
'unsigned int' but is then used to receive the return value of
clk_get_by_index which returns an int. The value of ret is then tested
for being less than 0 which will always fail for an unsigned variable.
Fix this by declaring ret as an 'int' so that the test for the error
condition is valid.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
drivers/clk/exynos/clk-exynos7420.c