aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/mxs/mxs-saif.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2016-12-12 22:05:20 +0100
committerTakashi Iwai <tiwai@suse.de>2016-12-12 22:05:20 +0100
commit152fce5a2371f64c57abf99dbb0600cc18d399d4 (patch)
treef3b4b8c2cf88cbd5a4a880f8c74b5d23f3f24982 /sound/soc/mxs/mxs-saif.c
parentMerge branch 'for-linus' into for-next (diff)
parentMerge remote-tracking branches 'asoc/topic/wm9712', 'asoc/topic/wm9713' and 'asoc/topic/zte' into asoc-next (diff)
downloadlinux-dev-152fce5a2371f64c57abf99dbb0600cc18d399d4.tar.xz
linux-dev-152fce5a2371f64c57abf99dbb0600cc18d399d4.zip
Merge tag 'asoc-v4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Updates for v4.10 There's been a few bits of framework work this time around and quite a lot of cleanups and improvements to existing code: - Support for stereo DAPM controls from Chen-yu Tsai. - Some initial work on the of-graph sound card from Morimoto-san, the main bulk of this is currently in binding review. - Lots of Renesas cleanups from Morimoto-san and sunxi work from Chen-yu Tsai. - regmap conversions of the remaining AC'97 drivers from Lars-Peter Clausen. - A new version of the topology ABI from Mengdong Lin. - New drivers for Cirrus Logic CS42L42, Qualcomm MSM8916-WCD, and Realtek RT5665.
Diffstat (limited to 'sound/soc/mxs/mxs-saif.c')
-rw-r--r--sound/soc/mxs/mxs-saif.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/sound/soc/mxs/mxs-saif.c b/sound/soc/mxs/mxs-saif.c
index 13631003cb7c..a002ab892772 100644
--- a/sound/soc/mxs/mxs-saif.c
+++ b/sound/soc/mxs/mxs-saif.c
@@ -735,6 +735,11 @@ static int mxs_saif_probe(struct platform_device *pdev)
else
saif->id = ret;
+ if (saif->id >= ARRAY_SIZE(mxs_saif)) {
+ dev_err(&pdev->dev, "get wrong saif id\n");
+ return -EINVAL;
+ }
+
/*
* If there is no "fsl,saif-master" phandle, it's a saif
* master. Otherwise, it's a slave and its phandle points
@@ -749,11 +754,11 @@ static int mxs_saif_probe(struct platform_device *pdev)
return ret;
else
saif->master_id = ret;
- }
- if (saif->master_id >= ARRAY_SIZE(mxs_saif)) {
- dev_err(&pdev->dev, "get wrong master id\n");
- return -EINVAL;
+ if (saif->master_id >= ARRAY_SIZE(mxs_saif)) {
+ dev_err(&pdev->dev, "get wrong master id\n");
+ return -EINVAL;
+ }
}
mxs_saif[saif->id] = saif;