From: Krzysztof Kozlowski Date: Fri, 28 Jun 2024 09:58:30 +0000 (+0200) Subject: ASoC: codecs: lpass-rx-macro: Fix using NULL pointer in probe() dev_err X-Git-Tag: v6.11-rc1~108^2~6^2~45 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2e068fe01ecbf677d414d4c1b02eea1636dd614c;p=thirdparty%2Fkernel%2Flinux.git ASoC: codecs: lpass-rx-macro: Fix using NULL pointer in probe() dev_err The 'rx->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: dbacef05898d ("ASoC: codec: lpass-rx-macro: prepare driver to accomdate new codec versions") Signed-off-by: Krzysztof Kozlowski Reviewed-by: Dmitry Baryshkov Link: https://patch.msgid.link/20240628095831.207942-1-krzysztof.kozlowski@linaro.org Signed-off-by: Mark Brown --- diff --git a/sound/soc/codecs/lpass-rx-macro.c b/sound/soc/codecs/lpass-rx-macro.c index 9c4f0763675d6..d47c49c90de36 100644 --- a/sound/soc/codecs/lpass-rx-macro.c +++ b/sound/soc/codecs/lpass-rx-macro.c @@ -3842,7 +3842,7 @@ static int rx_macro_probe(struct platform_device *pdev) rx_2_5_defaults, sizeof(rx_2_5_defaults)); break; default: - dev_err(rx->dev, "Unsupported Codec version (%d)\n", rx->codec_version); + dev_err(dev, "Unsupported Codec version (%d)\n", rx->codec_version); ret = -EINVAL; goto err; }