pwm: meson: Stop premature exit from for loop
authorAndrew Goodbody <andrew.goodbody@linaro.org>
Fri, 8 Aug 2025 09:34:43 +0000 (10:34 +0100)
committerNeil Armstrong <neil.armstrong@linaro.org>
Tue, 30 Sep 2025 18:32:15 +0000 (20:32 +0200)
commitb1e2cbd65cdfbc32c222eccedac11f53390694cf
tree380a300f8fc85a26066ab62c8a7f12c9f1962745
parentbb2d7ea6f2a8b9539f9daf526b5f87c29ce413b4
pwm: meson: Stop premature exit from for loop

In meson_pwm_probe the for loop attempts to get the name of a clock but
the following if..else statements only perform useful work if -ENODATA
is returned from clk_get_by_name. If clk_get_by_name simply succeeds
then this results in a premature exit from the for loop and the
following code can never be reached. Make the else clause only apply for
an error return from clk_get_by_name.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20250808-pwm_meson-v1-1-cddb7e5f76bd@linaro.org
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
drivers/pwm/pwm-meson.c