diff options
author | Takashi Iwai <tiwai@suse.de> | 2018-04-25 10:41:08 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2018-04-25 16:44:36 +0200 |
commit | 4d31c6e41ed2f95f97a19766812797dabd82a5ee (patch) | |
tree | e1f81f4f0108ff86f85b8e17b025b21609aec7b2 /include/sound | |
parent | 08605068df8bf52c0ec5a8897ddf2b4de753c9d0 (diff) | |
parent | 8a7d6003df41cb16f6b3b620da044fbd92d2f5ee (diff) | |
download | linux-4d31c6e41ed2f95f97a19766812797dabd82a5ee.tar.bz2 |
Merge branch 'for-linus' into for-next
Back-merge 4.17-rc3 fixes for further development.
This will bump the base to 4.17-rc2, too.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'include/sound')
-rw-r--r-- | include/sound/control.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/include/sound/control.h b/include/sound/control.h index ca13a44ae9d4..6011a58d3e20 100644 --- a/include/sound/control.h +++ b/include/sound/control.h @@ -23,6 +23,7 @@ */ #include <linux/wait.h> +#include <linux/nospec.h> #include <sound/asound.h> #define snd_kcontrol_chip(kcontrol) ((kcontrol)->private_data) @@ -148,12 +149,14 @@ int snd_ctl_get_preferred_subdevice(struct snd_card *card, int type); static inline unsigned int snd_ctl_get_ioffnum(struct snd_kcontrol *kctl, struct snd_ctl_elem_id *id) { - return id->numid - kctl->id.numid; + unsigned int ioff = id->numid - kctl->id.numid; + return array_index_nospec(ioff, kctl->count); } static inline unsigned int snd_ctl_get_ioffidx(struct snd_kcontrol *kctl, struct snd_ctl_elem_id *id) { - return id->index - kctl->id.index; + unsigned int ioff = id->index - kctl->id.index; + return array_index_nospec(ioff, kctl->count); } static inline unsigned int snd_ctl_get_ioff(struct snd_kcontrol *kctl, struct snd_ctl_elem_id *id) |