Merge tag 'pinctrl-v4.15-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw...
[linux-2.6-block.git] / sound / core / hwdep.c
index a73baa1242beeaf6c714f4c0986fd057286d50d6..8faae3d1455df18c330f8e59785722dc0aecaa80 100644 (file)
@@ -228,6 +228,8 @@ static int snd_hwdep_dsp_load(struct snd_hwdep *hw,
        memset(&info, 0, sizeof(info));
        if (copy_from_user(&info, _info, sizeof(info)))
                return -EFAULT;
+       if (info.index >= 32)
+               return -EINVAL;
        /* check whether the dsp was already loaded */
        if (hw->dsp_loaded & (1 << info.index))
                return -EBUSY;