]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
ASoC: tegra210_ahub: Add check to of_device_get_match_data()
authorYuanjun Gong <ruc_gongyuanjun@163.com>
Tue, 13 May 2025 12:37:44 +0000 (20:37 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Jun 2025 10:04:15 +0000 (11:04 +0100)
[ Upstream commit 04cb269c204398763a620d426cbee43064854000 ]

In tegra_ahub_probe(), check the result of function
of_device_get_match_data(), return an error code in case it fails.

Signed-off-by: Yuanjun Gong <ruc_gongyuanjun@163.com>
Link: https://patch.msgid.link/20250513123744.3041724-1-ruc_gongyuanjun@163.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/soc/tegra/tegra210_ahub.c

index 1b2f7cb8c6adc2b2168906253c111f6faa74def2..686c8ff46ec8a1dd2b7311b82400d68ca5bdb6dd 100644 (file)
@@ -607,6 +607,8 @@ static int tegra_ahub_probe(struct platform_device *pdev)
                return -ENOMEM;
 
        ahub->soc_data = of_device_get_match_data(&pdev->dev);
+       if (!ahub->soc_data)
+               return -ENODEV;
 
        platform_set_drvdata(pdev, ahub);