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:
Dipesh Gandhi
2015-12-16 15:53:01 +05:30
committed by Sameer Pujar
parent 21823baa4b
commit eceb04d76a
2 changed files with 9 additions and 4 deletions

View File

@@ -111,6 +111,7 @@ static int tegra186_arad_suspend(struct device *dev)
{
struct tegra186_arad *arad = dev_get_drvdata(dev);
if (arad)
regcache_mark_dirty(arad->regmap);
return 0;
@@ -799,7 +800,6 @@ static int tegra186_arad_platform_probe(struct platform_device *pdev)
ret = -ENOMEM;
goto err;
}
dev_set_drvdata(&pdev->dev, arad);
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);
#endif
#endif
dev_set_drvdata(&pdev->dev, arad);
return 0;
err_suspend:

View File

@@ -223,7 +223,9 @@ static int tegra186_asrc_suspend(struct device *dev)
{
struct tegra186_asrc *asrc = dev_get_drvdata(dev);
if (asrc)
regcache_mark_dirty(asrc->regmap);
return 0;
}
#endif
@@ -896,7 +898,6 @@ static int tegra186_asrc_platform_probe(struct platform_device *pdev)
ret = -ENOMEM;
goto err;
}
dev_set_drvdata(&pdev->dev, asrc);
asrc->soc_data = soc_data;
@@ -972,6 +973,8 @@ static int tegra186_asrc_platform_probe(struct platform_device *pdev)
goto err_suspend;
}
dev_set_drvdata(&pdev->dev, asrc);
return 0;
err_suspend: