diff options
| -rw-r--r-- | sound/soc/mxs/mxs-saif.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sound/soc/mxs/mxs-saif.c b/sound/soc/mxs/mxs-saif.c index 530017f7d14a..af5734f6dab7 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) | |||
| 521 | struct mxs_saif *saif; | 521 | struct mxs_saif *saif; |
| 522 | int ret = 0; | 522 | int ret = 0; |
| 523 | 523 | ||
| 524 | if (pdev->id >= ARRAY_SIZE(mxs_saif)) | ||
| 525 | return -EINVAL; | ||
| 526 | |||
| 524 | saif = kzalloc(sizeof(*saif), GFP_KERNEL); | 527 | saif = kzalloc(sizeof(*saif), GFP_KERNEL); |
| 525 | if (!saif) | 528 | if (!saif) |
| 526 | return -ENOMEM; | 529 | return -ENOMEM; |
| 527 | 530 | ||
| 528 | if (pdev->id >= ARRAY_SIZE(mxs_saif)) | ||
| 529 | return -EINVAL; | ||
| 530 | mxs_saif[pdev->id] = saif; | 531 | mxs_saif[pdev->id] = saif; |
| 531 | 532 | ||
| 532 | saif->clk = clk_get(&pdev->dev, NULL); | 533 | saif->clk = clk_get(&pdev->dev, NULL); |
