|
|
@@ -36,6 +36,7 @@
|
|
|
#include <linux/init.h>
|
|
|
#include <linux/mutex.h>
|
|
|
#include <linux/moduleparam.h>
|
|
|
+#include <linux/nospec.h>
|
|
|
|
|
|
#include <sound/core.h>
|
|
|
#include <sound/tlv.h>
|
|
|
@@ -1026,6 +1027,8 @@ static int snd_emu10k1_ipcm_poke(struct snd_emu10k1 *emu,
|
|
|
|
|
|
if (ipcm->substream >= EMU10K1_FX8010_PCM_COUNT)
|
|
|
return -EINVAL;
|
|
|
+ ipcm->substream = array_index_nospec(ipcm->substream,
|
|
|
+ EMU10K1_FX8010_PCM_COUNT);
|
|
|
if (ipcm->channels > 32)
|
|
|
return -EINVAL;
|
|
|
pcm = &emu->fx8010.pcm[ipcm->substream];
|
|
|
@@ -1072,6 +1075,8 @@ static int snd_emu10k1_ipcm_peek(struct snd_emu10k1 *emu,
|
|
|
|
|
|
if (ipcm->substream >= EMU10K1_FX8010_PCM_COUNT)
|
|
|
return -EINVAL;
|
|
|
+ ipcm->substream = array_index_nospec(ipcm->substream,
|
|
|
+ EMU10K1_FX8010_PCM_COUNT);
|
|
|
pcm = &emu->fx8010.pcm[ipcm->substream];
|
|
|
mutex_lock(&emu->fx8010.lock);
|
|
|
spin_lock_irq(&emu->reg_lock);
|