clk_get_parent() returns NULL when the clock has no parent (or when the
input clk is NULL); it never returns an ERR_PTR. The current IS_ERR(mux)
check therefore never triggers - a NULL return falls through silently
to clk_set_parent(NULL, parent_clk), which simply fails with -EINVAL.
Use a NULL check so the dedicated error path runs and the prior
clk_get() reference is released via clk_put().
Signed-off-by: Ingyu Jang <ingyujang25@korea.ac.kr>
Acked-by: Sen Wang <sen@ti.com>
Link: https://patch.msgid.link/20260514185215.3753998-1-ingyujang25@korea.ac.kr
Signed-off-by: Mark Brown <broonie@kernel.org>
}
mux = clk_get_parent(dmic->fclk);
- if (IS_ERR(mux)) {
+ if (!mux) {
dev_err(dmic->dev, "can't get fck mux parent\n");
clk_put(parent_clk);
return -ENODEV;