diff mbox series

[2/2] ASoC: codecs: lpass-wsa-macro: Fix using NULL pointer in probe() dev_err

Message ID 20240628095831.207942-2-krzysztof.kozlowski@linaro.org (mailing list archive)
State Accepted
Commit 765d3a2aa195882e231835f5d9ac4d99affc8c07
Headers show
Series [1/2] ASoC: codecs: lpass-rx-macro: Fix using NULL pointer in probe() dev_err | expand

Commit Message

Krzysztof Kozlowski June 28, 2024, 9:58 a.m. UTC
The 'wsa->dev' is assigned closer to the end of the probe() function, so
the dev_err() must not use it - it is still NULL at this point.  Instead
there is already a local 'dev' variable.

Fixes: 727de4fbc546 ("ASoC: codecs: lpass-wsa-macro: Correct support for newer v2.5 version")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 sound/soc/codecs/lpass-wsa-macro.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Dmitry Baryshkov July 1, 2024, 6:30 p.m. UTC | #1
On Fri, Jun 28, 2024 at 11:58:31AM GMT, Krzysztof Kozlowski wrote:
> The 'wsa->dev' is assigned closer to the end of the probe() function, so
> the dev_err() must not use it - it is still NULL at this point.  Instead
> there is already a local 'dev' variable.
> 
> Fixes: 727de4fbc546 ("ASoC: codecs: lpass-wsa-macro: Correct support for newer v2.5 version")
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
>  sound/soc/codecs/lpass-wsa-macro.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
diff mbox series

Patch

diff --git a/sound/soc/codecs/lpass-wsa-macro.c b/sound/soc/codecs/lpass-wsa-macro.c
index f619b06b8aec..14e0cc4fbff3 100644
--- a/sound/soc/codecs/lpass-wsa-macro.c
+++ b/sound/soc/codecs/lpass-wsa-macro.c
@@ -2798,7 +2798,7 @@  static int wsa_macro_probe(struct platform_device *pdev)
 		break;
 
 	default:
-		dev_err(wsa->dev, "Unsupported Codec version (%d)\n", wsa->codec_version);
+		dev_err(dev, "Unsupported Codec version (%d)\n", wsa->codec_version);
 		return -EINVAL;
 	}