summaryrefslogtreecommitdiffstats
path: root/sound/soc/mxs/mxs-saif.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/mxs/mxs-saif.c')
-rw-r--r--sound/soc/mxs/mxs-saif.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sound/soc/mxs/mxs-saif.c b/sound/soc/mxs/mxs-saif.c
index 530017f7d14..af5734f6dab 100644
--- a/sound/soc/mxs/mxs-saif.c
+++ b/sound/soc/mxs/mxs-saif.c
@@ -521,12 +521,13 @@ static int mxs_saif_probe(struct platform_device *pdev)
struct mxs_saif *saif;
int ret = 0;
+ if (pdev->id >= ARRAY_SIZE(mxs_saif))
+ return -EINVAL;
+
saif = kzalloc(sizeof(*saif), GFP_KERNEL);
if (!saif)
return -ENOMEM;
- if (pdev->id >= ARRAY_SIZE(mxs_saif))
- return -EINVAL;
mxs_saif[pdev->id] = saif;
saif->clk = clk_get(&pdev->dev, NULL);