History

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

Pull sound fixes from Takashi Iwai: "A few small fixes: - a fix for the NULL-dereference in rawmidi compat ioctls, triggered by fuzzer - HD-audio Realtek codec quirks, a VIA controller fixup - a long-standing bug fix in LINE6 MIDI" * tag 'sound-4.17-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: rawmidi: Fix missing input substream checks in compat ioctls ALSA: hda/realtek - adjust the location of one mic ALSA: hda/realtek - set PINCFG_HEADSET_MIC to parse_flags ALSA: hda - New VIA controller suppor no-snoop path ALSA: line6: Use correct endpoint type for midi output

Linus Torvalds committed 8 years ago

Commit 5e7c7802 parents e46096b 8a56ef44 files · +18 −8Browse files

Unified · Split

4 files
  1. sound/core/rawmidi_compat.c +12 −6
  2. sound/pci/hda/hda_intel.c +2 −1
  3. sound/pci/hda/patch_realtek.c +3 −0
  4. sound/usb/line6/midi.c +1 −1
sound/core/rawmidi_compat.c+12−6
@@ -36,8 +36,6 @@ static int snd_rawmidi_ioctl_params_compat(struct snd_rawmidi_file *rfile, · 35 unmodified lines
3636 struct snd_rawmidi_params params;
3737 unsigned int val;
3838
39− if (rfile->output == NULL)
40− return -EINVAL;
4139 if (get_user(params.stream, &src->stream) ||
4240 get_user(params.buffer_size, &src->buffer_size) ||
4341 get_user(params.avail_min, &src->avail_min) ||
@@ -46,8 +44,12 @@ static int snd_rawmidi_ioctl_params_compat(struct snd_rawmidi_file *rfile, · 2 unmodified lines
4644 params.no_active_sensing = val;
4745 switch (params.stream) {
4846 case SNDRV_RAWMIDI_STREAM_OUTPUT:
47+ if (!rfile->output)
48+ return -EINVAL;
4949 return snd_rawmidi_output_params(rfile->output, &params);
5050 case SNDRV_RAWMIDI_STREAM_INPUT:
51+ if (!rfile->input)
52+ return -EINVAL;
5153 return snd_rawmidi_input_params(rfile->input, &params);
5254 }
5355 return -EINVAL;
@@ -67,16 +69,18 @@ static int snd_rawmidi_ioctl_status_compat(struct snd_rawmidi_file *rfile, · 13 unmodified lines
6769 int err;
6870 struct snd_rawmidi_status status;
6971
70− if (rfile->output == NULL)
71− return -EINVAL;
7272 if (get_user(status.stream, &src->stream))
7373 return -EFAULT;
7474
7575 switch (status.stream) {
7676 case SNDRV_RAWMIDI_STREAM_OUTPUT:
77+ if (!rfile->output)
78+ return -EINVAL;
7779 err = snd_rawmidi_output_status(rfile->output, &status);
7880 break;
7981 case SNDRV_RAWMIDI_STREAM_INPUT:
82+ if (!rfile->input)
83+ return -EINVAL;
8084 err = snd_rawmidi_input_status(rfile->input, &status);
8185 break;
8286 default:
@@ -112,16 +116,18 @@ static int snd_rawmidi_ioctl_status_x32(struct snd_rawmidi_file *rfile, · 29 unmodified lines
112116 int err;
113117 struct snd_rawmidi_status status;
114118
115− if (rfile->output == NULL)
116− return -EINVAL;
117119 if (get_user(status.stream, &src->stream))
118120 return -EFAULT;
119121
120122 switch (status.stream) {
121123 case SNDRV_RAWMIDI_STREAM_OUTPUT:
124+ if (!rfile->output)
125+ return -EINVAL;
122126 err = snd_rawmidi_output_status(rfile->output, &status);
123127 break;
124128 case SNDRV_RAWMIDI_STREAM_INPUT:
129+ if (!rfile->input)
130+ return -EINVAL;
125131 err = snd_rawmidi_input_status(rfile->input, &status);
126132 break;
127133 default:
sound/pci/hda/hda_intel.c+2−1
@@ -1647,7 +1647,8 @@ static void azx_check_snoop_available(struct azx *chip) · 1646 unmodified lines
16471647 */
16481648 u8 val;
16491649 pci_read_config_byte(chip->pci, 0x42, &val);
1650− if (!(val & 0x80) && chip->pci->revision == 0x30)
1650+ if (!(val & 0x80) && (chip->pci->revision == 0x30 ||
1651+ chip->pci->revision == 0x20))
16511652 snoop = false;
16521653 }
16531654
sound/pci/hda/patch_realtek.c+3−0
@@ -6370,6 +6370,8 @@ static const struct hda_fixup alc269_fixups[] = { · 6369 unmodified lines
63706370 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
63716371 { }
63726372 },
6373+ .chained = true,
6374+ .chain_id = ALC269_FIXUP_HEADSET_MIC
63736375 },
63746376 };
63756377
@@ -6573,6 +6575,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { · 197 unmodified lines
65736575 SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
65746576 SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
65756577 SND_PCI_QUIRK(0x17aa, 0x310c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
6578+ SND_PCI_QUIRK(0x17aa, 0x3138, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
65766579 SND_PCI_QUIRK(0x17aa, 0x313c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
65776580 SND_PCI_QUIRK(0x17aa, 0x3112, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
65786581 SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
sound/usb/line6/midi.c+1−1
@@ -125,7 +125,7 @@ static int send_midi_async(struct usb_line6 *line6, unsigned char *data, · 124 unmodified lines
125125 }
126126
127127 usb_fill_int_urb(urb, line6->usbdev,
128− usb_sndbulkpipe(line6->usbdev,
128+ usb_sndintpipe(line6->usbdev,
129129 line6->properties->ep_ctrl_w),
130130 transfer_buffer, length, midi_sent, line6,
131131 line6->interval);