diff options
-rw-r--r-- | sound/soc/codecs/wm9081.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sound/soc/codecs/wm9081.c b/sound/soc/codecs/wm9081.c index dbe20597d872..156f2a4a5930 100644 --- a/sound/soc/codecs/wm9081.c +++ b/sound/soc/codecs/wm9081.c | |||
@@ -707,6 +707,10 @@ static int configure_clock(struct snd_soc_codec *codec) | |||
707 | target > 3000000) | 707 | target > 3000000) |
708 | break; | 708 | break; |
709 | } | 709 | } |
710 | |||
711 | if (i == ARRAY_SIZE(clk_sys_rates)) | ||
712 | return -EINVAL; | ||
713 | |||
710 | } else if (wm9081->fs) { | 714 | } else if (wm9081->fs) { |
711 | for (i = 0; i < ARRAY_SIZE(clk_sys_rates); i++) { | 715 | for (i = 0; i < ARRAY_SIZE(clk_sys_rates); i++) { |
712 | new_sysclk = clk_sys_rates[i].ratio | 716 | new_sysclk = clk_sys_rates[i].ratio |
@@ -714,6 +718,10 @@ static int configure_clock(struct snd_soc_codec *codec) | |||
714 | if (new_sysclk > 3000000) | 718 | if (new_sysclk > 3000000) |
715 | break; | 719 | break; |
716 | } | 720 | } |
721 | |||
722 | if (i == ARRAY_SIZE(clk_sys_rates)) | ||
723 | return -EINVAL; | ||
724 | |||
717 | } else { | 725 | } else { |
718 | new_sysclk = 12288000; | 726 | new_sysclk = 12288000; |
719 | } | 727 | } |