From 9e07f8bfd959d2d09823430eab35d12182446dcf Mon Sep 17 00:00:00 2001 From: Harshit Mogalapalli Date: Tue, 29 Aug 2023 00:36:35 -0700 Subject: [PATCH] ASoC: cs42l43: Fix missing error code in cs42l43_codec_probe() When clk_get_optional() fails, the error handling code does a 'goto err_pm' with ret = 0, which is resturning success on a failure path. Fix this by assigning the PTR_ERR(priv-mclk) to ret variable. Fixes: fc918cbe874e ("ASoC: cs42l43: Add support for the cs42l43") Signed-off-by: Harshit Mogalapalli mclk = clk_get_optional(cs42l43->dev, "mclk"); if (IS_ERR(priv->mclk)) { - dev_err_probe(priv->dev, PTR_ERR(priv->mclk), "Failed to get mclk\n"); + ret = PTR_ERR(priv->mclk); + dev_err_probe(priv->dev, ret, "Failed to get mclk\n"); goto err_pm; }