]> git.ipfire.org Git - thirdparty/linux.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)
committerMark Brown <broonie@kernel.org>
Wed, 14 May 2025 07:47:36 +0000 (09:47 +0200)
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>
sound/soc/tegra/tegra210_ahub.c

index 99683f292b5d849f51985e9f5c8b2b8cb47d5c49..ae4965a9f7649eb6f86e37bc109e50fad38b9fe4 100644 (file)
@@ -1359,6 +1359,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);