mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 17:25:35 +03:00
ASoC: tegra-alt: add check pointer before access
add check for context pointer before accessing it in suspend for asrc and arad. Bug 200160608 Change-Id: If549bf77e8d2a2ab66507127930bfa7c474ea782 Signed-off-by: Dipesh Gandhi <dipeshg@nvidia.com> Reviewed-on: http://git-master/r/923558 GVS: Gerrit_Virtual_Submit Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com> Reviewed-by: Nitin Kumbhar <nkumbhar@nvidia.com>
This commit is contained in:
committed by
Sameer Pujar
parent
21823baa4b
commit
eceb04d76a
@@ -111,7 +111,8 @@ static int tegra186_arad_suspend(struct device *dev)
|
|||||||
{
|
{
|
||||||
struct tegra186_arad *arad = dev_get_drvdata(dev);
|
struct tegra186_arad *arad = dev_get_drvdata(dev);
|
||||||
|
|
||||||
regcache_mark_dirty(arad->regmap);
|
if (arad)
|
||||||
|
regcache_mark_dirty(arad->regmap);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -799,7 +800,6 @@ static int tegra186_arad_platform_probe(struct platform_device *pdev)
|
|||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
dev_set_drvdata(&pdev->dev, arad);
|
|
||||||
|
|
||||||
arad->soc_data = soc_data;
|
arad->soc_data = soc_data;
|
||||||
|
|
||||||
@@ -862,6 +862,8 @@ static int tegra186_arad_platform_probe(struct platform_device *pdev)
|
|||||||
TEGRA186_AHC_ARAD1_CB, &pdev->dev);
|
TEGRA186_AHC_ARAD1_CB, &pdev->dev);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
dev_set_drvdata(&pdev->dev, arad);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
err_suspend:
|
err_suspend:
|
||||||
|
|||||||
@@ -223,7 +223,9 @@ static int tegra186_asrc_suspend(struct device *dev)
|
|||||||
{
|
{
|
||||||
struct tegra186_asrc *asrc = dev_get_drvdata(dev);
|
struct tegra186_asrc *asrc = dev_get_drvdata(dev);
|
||||||
|
|
||||||
regcache_mark_dirty(asrc->regmap);
|
if (asrc)
|
||||||
|
regcache_mark_dirty(asrc->regmap);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -896,7 +898,6 @@ static int tegra186_asrc_platform_probe(struct platform_device *pdev)
|
|||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
dev_set_drvdata(&pdev->dev, asrc);
|
|
||||||
|
|
||||||
asrc->soc_data = soc_data;
|
asrc->soc_data = soc_data;
|
||||||
|
|
||||||
@@ -972,6 +973,8 @@ static int tegra186_asrc_platform_probe(struct platform_device *pdev)
|
|||||||
goto err_suspend;
|
goto err_suspend;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dev_set_drvdata(&pdev->dev, asrc);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
err_suspend:
|
err_suspend:
|
||||||
|
|||||||
Reference in New Issue
Block a user