Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'sound-5.6-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
"A few fixes covering the issues reported by syzkaller, a couple of
fixes for the MIDI decoding bug, and a few usual HD-audio quirks.

Some of them are about ALSA core stuff, but they are small fixes just
for corner cases, and nothing thrilling"

* tag 'sound-5.6-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
ALSA: hda/realtek - Enable the headset of Acer N50-600 with ALC662
ALSA: hda/realtek - Enable headset mic of Acer X2660G with ALC662
ALSA: seq: oss: Fix running status after receiving sysex
ALSA: seq: virmidi: Fix running status after receiving sysex
ALSA: pcm: oss: Remove WARNING from snd_pcm_plug_alloc() checks
ALSA: hda/realtek: Fix pop noise on ALC225
ALSA: line6: Fix endless MIDI read loop
ALSA: pcm: oss: Avoid plugin buffer overflow

+39 -4
+10 -2
sound/core/oss/pcm_plugin.c
··· 111 111 while (plugin->next) { 112 112 if (plugin->dst_frames) 113 113 frames = plugin->dst_frames(plugin, frames); 114 - if (snd_BUG_ON((snd_pcm_sframes_t)frames <= 0)) 114 + if ((snd_pcm_sframes_t)frames <= 0) 115 115 return -ENXIO; 116 116 plugin = plugin->next; 117 117 err = snd_pcm_plugin_alloc(plugin, frames); ··· 123 123 while (plugin->prev) { 124 124 if (plugin->src_frames) 125 125 frames = plugin->src_frames(plugin, frames); 126 - if (snd_BUG_ON((snd_pcm_sframes_t)frames <= 0)) 126 + if ((snd_pcm_sframes_t)frames <= 0) 127 127 return -ENXIO; 128 128 plugin = plugin->prev; 129 129 err = snd_pcm_plugin_alloc(plugin, frames); ··· 209 209 if (stream == SNDRV_PCM_STREAM_PLAYBACK) { 210 210 plugin = snd_pcm_plug_last(plug); 211 211 while (plugin && drv_frames > 0) { 212 + if (drv_frames > plugin->buf_frames) 213 + drv_frames = plugin->buf_frames; 212 214 plugin_prev = plugin->prev; 213 215 if (plugin->src_frames) 214 216 drv_frames = plugin->src_frames(plugin, drv_frames); ··· 222 220 plugin_next = plugin->next; 223 221 if (plugin->dst_frames) 224 222 drv_frames = plugin->dst_frames(plugin, drv_frames); 223 + if (drv_frames > plugin->buf_frames) 224 + drv_frames = plugin->buf_frames; 225 225 plugin = plugin_next; 226 226 } 227 227 } else ··· 252 248 if (frames < 0) 253 249 return frames; 254 250 } 251 + if (frames > plugin->buf_frames) 252 + frames = plugin->buf_frames; 255 253 plugin = plugin_next; 256 254 } 257 255 } else if (stream == SNDRV_PCM_STREAM_CAPTURE) { 258 256 plugin = snd_pcm_plug_last(plug); 259 257 while (plugin) { 258 + if (frames > plugin->buf_frames) 259 + frames = plugin->buf_frames; 260 260 plugin_prev = plugin->prev; 261 261 if (plugin->src_frames) { 262 262 frames = plugin->src_frames(plugin, frames);
+1
sound/core/seq/oss/seq_oss_midi.c
··· 602 602 len = snd_seq_oss_timer_start(dp->timer); 603 603 if (ev->type == SNDRV_SEQ_EVENT_SYSEX) { 604 604 snd_seq_oss_readq_sysex(dp->readq, mdev->seq_device, ev); 605 + snd_midi_event_reset_decode(mdev->coder); 605 606 } else { 606 607 len = snd_midi_event_decode(mdev->coder, msg, sizeof(msg), ev); 607 608 if (len > 0)
+1
sound/core/seq/seq_virmidi.c
··· 81 81 if ((ev->flags & SNDRV_SEQ_EVENT_LENGTH_MASK) != SNDRV_SEQ_EVENT_LENGTH_VARIABLE) 82 82 continue; 83 83 snd_seq_dump_var_event(ev, (snd_seq_dump_func_t)snd_rawmidi_receive, vmidi->substream); 84 + snd_midi_event_reset_decode(vmidi->parser); 84 85 } else { 85 86 len = snd_midi_event_decode(vmidi->parser, msg, sizeof(msg), ev); 86 87 if (len > 0)
+25
sound/pci/hda/patch_realtek.c
··· 8051 8051 spec->gen.mixer_nid = 0; 8052 8052 break; 8053 8053 case 0x10ec0225: 8054 + codec->power_save_node = 1; 8055 + /* fall through */ 8054 8056 case 0x10ec0295: 8055 8057 case 0x10ec0299: 8056 8058 spec->codec_variant = ALC269_TYPE_ALC225; ··· 8612 8610 ALC669_FIXUP_ACER_ASPIRE_ETHOS, 8613 8611 ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET, 8614 8612 ALC671_FIXUP_HP_HEADSET_MIC2, 8613 + ALC662_FIXUP_ACER_X2660G_HEADSET_MODE, 8614 + ALC662_FIXUP_ACER_NITRO_HEADSET_MODE, 8615 8615 }; 8616 8616 8617 8617 static const struct hda_fixup alc662_fixups[] = { ··· 8959 8955 .type = HDA_FIXUP_FUNC, 8960 8956 .v.func = alc671_fixup_hp_headset_mic2, 8961 8957 }, 8958 + [ALC662_FIXUP_ACER_X2660G_HEADSET_MODE] = { 8959 + .type = HDA_FIXUP_PINS, 8960 + .v.pins = (const struct hda_pintbl[]) { 8961 + { 0x1a, 0x02a1113c }, /* use as headset mic, without its own jack detect */ 8962 + { } 8963 + }, 8964 + .chained = true, 8965 + .chain_id = ALC662_FIXUP_USI_FUNC 8966 + }, 8967 + [ALC662_FIXUP_ACER_NITRO_HEADSET_MODE] = { 8968 + .type = HDA_FIXUP_PINS, 8969 + .v.pins = (const struct hda_pintbl[]) { 8970 + { 0x1a, 0x01a11140 }, /* use as headset mic, without its own jack detect */ 8971 + { 0x1b, 0x0221144f }, 8972 + { } 8973 + }, 8974 + .chained = true, 8975 + .chain_id = ALC662_FIXUP_USI_FUNC 8976 + }, 8962 8977 }; 8963 8978 8964 8979 static const struct snd_pci_quirk alc662_fixup_tbl[] = { ··· 8989 8966 SND_PCI_QUIRK(0x1025, 0x0349, "eMachines eM250", ALC662_FIXUP_INV_DMIC), 8990 8967 SND_PCI_QUIRK(0x1025, 0x034a, "Gateway LT27", ALC662_FIXUP_INV_DMIC), 8991 8968 SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE), 8969 + SND_PCI_QUIRK(0x1025, 0x123c, "Acer Nitro N50-600", ALC662_FIXUP_ACER_NITRO_HEADSET_MODE), 8970 + SND_PCI_QUIRK(0x1025, 0x124e, "Acer 2660G", ALC662_FIXUP_ACER_X2660G_HEADSET_MODE), 8992 8971 SND_PCI_QUIRK(0x1028, 0x05d8, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), 8993 8972 SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), 8994 8973 SND_PCI_QUIRK(0x1028, 0x05fe, "Dell XPS 15", ALC668_FIXUP_DELL_XPS13),
+1 -1
sound/usb/line6/driver.c
··· 305 305 line6_midibuf_read(mb, line6->buffer_message, 306 306 LINE6_MIDI_MESSAGE_MAXLEN); 307 307 308 - if (done == 0) 308 + if (done <= 0) 309 309 break; 310 310 311 311 line6->message_length = done;
+1 -1
sound/usb/line6/midibuf.c
··· 159 159 int midi_length_prev = 160 160 midibuf_message_length(this->command_prev); 161 161 162 - if (midi_length_prev > 0) { 162 + if (midi_length_prev > 1) { 163 163 midi_length = midi_length_prev - 1; 164 164 repeat = 1; 165 165 } else