Skip to content

Commit 12bf19c

Browse files
committed
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
2 parents 69d3e5a + a124458 commit 12bf19c

File tree

6 files changed

+39
-4
lines changed

6 files changed

+39
-4
lines changed

sound/core/oss/pcm_plugin.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ int snd_pcm_plug_alloc(struct snd_pcm_substream *plug, snd_pcm_uframes_t frames)
111111
while (plugin->next) {
112112
if (plugin->dst_frames)
113113
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)
115115
return -ENXIO;
116116
plugin = plugin->next;
117117
err = snd_pcm_plugin_alloc(plugin, frames);
@@ -123,7 +123,7 @@ int snd_pcm_plug_alloc(struct snd_pcm_substream *plug, snd_pcm_uframes_t frames)
123123
while (plugin->prev) {
124124
if (plugin->src_frames)
125125
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)
127127
return -ENXIO;
128128
plugin = plugin->prev;
129129
err = snd_pcm_plugin_alloc(plugin, frames);
@@ -209,6 +209,8 @@ snd_pcm_sframes_t snd_pcm_plug_client_size(struct snd_pcm_substream *plug, snd_p
209209
if (stream == SNDRV_PCM_STREAM_PLAYBACK) {
210210
plugin = snd_pcm_plug_last(plug);
211211
while (plugin && drv_frames > 0) {
212+
if (drv_frames > plugin->buf_frames)
213+
drv_frames = plugin->buf_frames;
212214
plugin_prev = plugin->prev;
213215
if (plugin->src_frames)
214216
drv_frames = plugin->src_frames(plugin, drv_frames);
@@ -220,6 +222,8 @@ snd_pcm_sframes_t snd_pcm_plug_client_size(struct snd_pcm_substream *plug, snd_p
220222
plugin_next = plugin->next;
221223
if (plugin->dst_frames)
222224
drv_frames = plugin->dst_frames(plugin, drv_frames);
225+
if (drv_frames > plugin->buf_frames)
226+
drv_frames = plugin->buf_frames;
223227
plugin = plugin_next;
224228
}
225229
} else
@@ -248,11 +252,15 @@ snd_pcm_sframes_t snd_pcm_plug_slave_size(struct snd_pcm_substream *plug, snd_pc
248252
if (frames < 0)
249253
return frames;
250254
}
255+
if (frames > plugin->buf_frames)
256+
frames = plugin->buf_frames;
251257
plugin = plugin_next;
252258
}
253259
} else if (stream == SNDRV_PCM_STREAM_CAPTURE) {
254260
plugin = snd_pcm_plug_last(plug);
255261
while (plugin) {
262+
if (frames > plugin->buf_frames)
263+
frames = plugin->buf_frames;
256264
plugin_prev = plugin->prev;
257265
if (plugin->src_frames) {
258266
frames = plugin->src_frames(plugin, frames);

sound/core/seq/oss/seq_oss_midi.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,7 @@ send_midi_event(struct seq_oss_devinfo *dp, struct snd_seq_event *ev, struct seq
602602
len = snd_seq_oss_timer_start(dp->timer);
603603
if (ev->type == SNDRV_SEQ_EVENT_SYSEX) {
604604
snd_seq_oss_readq_sysex(dp->readq, mdev->seq_device, ev);
605+
snd_midi_event_reset_decode(mdev->coder);
605606
} else {
606607
len = snd_midi_event_decode(mdev->coder, msg, sizeof(msg), ev);
607608
if (len > 0)

sound/core/seq/seq_virmidi.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ static int snd_virmidi_dev_receive_event(struct snd_virmidi_dev *rdev,
8181
if ((ev->flags & SNDRV_SEQ_EVENT_LENGTH_MASK) != SNDRV_SEQ_EVENT_LENGTH_VARIABLE)
8282
continue;
8383
snd_seq_dump_var_event(ev, (snd_seq_dump_func_t)snd_rawmidi_receive, vmidi->substream);
84+
snd_midi_event_reset_decode(vmidi->parser);
8485
} else {
8586
len = snd_midi_event_decode(vmidi->parser, msg, sizeof(msg), ev);
8687
if (len > 0)

sound/pci/hda/patch_realtek.c

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8051,6 +8051,8 @@ static int patch_alc269(struct hda_codec *codec)
80518051
spec->gen.mixer_nid = 0;
80528052
break;
80538053
case 0x10ec0225:
8054+
codec->power_save_node = 1;
8055+
/* fall through */
80548056
case 0x10ec0295:
80558057
case 0x10ec0299:
80568058
spec->codec_variant = ALC269_TYPE_ALC225;
@@ -8610,6 +8612,8 @@ enum {
86108612
ALC669_FIXUP_ACER_ASPIRE_ETHOS,
86118613
ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET,
86128614
ALC671_FIXUP_HP_HEADSET_MIC2,
8615+
ALC662_FIXUP_ACER_X2660G_HEADSET_MODE,
8616+
ALC662_FIXUP_ACER_NITRO_HEADSET_MODE,
86138617
};
86148618

86158619
static const struct hda_fixup alc662_fixups[] = {
@@ -8955,6 +8959,25 @@ static const struct hda_fixup alc662_fixups[] = {
89558959
.type = HDA_FIXUP_FUNC,
89568960
.v.func = alc671_fixup_hp_headset_mic2,
89578961
},
8962+
[ALC662_FIXUP_ACER_X2660G_HEADSET_MODE] = {
8963+
.type = HDA_FIXUP_PINS,
8964+
.v.pins = (const struct hda_pintbl[]) {
8965+
{ 0x1a, 0x02a1113c }, /* use as headset mic, without its own jack detect */
8966+
{ }
8967+
},
8968+
.chained = true,
8969+
.chain_id = ALC662_FIXUP_USI_FUNC
8970+
},
8971+
[ALC662_FIXUP_ACER_NITRO_HEADSET_MODE] = {
8972+
.type = HDA_FIXUP_PINS,
8973+
.v.pins = (const struct hda_pintbl[]) {
8974+
{ 0x1a, 0x01a11140 }, /* use as headset mic, without its own jack detect */
8975+
{ 0x1b, 0x0221144f },
8976+
{ }
8977+
},
8978+
.chained = true,
8979+
.chain_id = ALC662_FIXUP_USI_FUNC
8980+
},
89588981
};
89598982

89608983
static const struct snd_pci_quirk alc662_fixup_tbl[] = {
@@ -8966,6 +8989,8 @@ static const struct snd_pci_quirk alc662_fixup_tbl[] = {
89668989
SND_PCI_QUIRK(0x1025, 0x0349, "eMachines eM250", ALC662_FIXUP_INV_DMIC),
89678990
SND_PCI_QUIRK(0x1025, 0x034a, "Gateway LT27", ALC662_FIXUP_INV_DMIC),
89688991
SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE),
8992+
SND_PCI_QUIRK(0x1025, 0x123c, "Acer Nitro N50-600", ALC662_FIXUP_ACER_NITRO_HEADSET_MODE),
8993+
SND_PCI_QUIRK(0x1025, 0x124e, "Acer 2660G", ALC662_FIXUP_ACER_X2660G_HEADSET_MODE),
89698994
SND_PCI_QUIRK(0x1028, 0x05d8, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
89708995
SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
89718996
SND_PCI_QUIRK(0x1028, 0x05fe, "Dell XPS 15", ALC668_FIXUP_DELL_XPS13),

sound/usb/line6/driver.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ static void line6_data_received(struct urb *urb)
305305
line6_midibuf_read(mb, line6->buffer_message,
306306
LINE6_MIDI_MESSAGE_MAXLEN);
307307

308-
if (done == 0)
308+
if (done <= 0)
309309
break;
310310

311311
line6->message_length = done;

sound/usb/line6/midibuf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ int line6_midibuf_read(struct midi_buffer *this, unsigned char *data,
159159
int midi_length_prev =
160160
midibuf_message_length(this->command_prev);
161161

162-
if (midi_length_prev > 0) {
162+
if (midi_length_prev > 1) {
163163
midi_length = midi_length_prev - 1;
164164
repeat = 1;
165165
} else

0 commit comments

Comments
 (0)