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
Unified · Split
| @@ -36,8 +36,6 @@ static int snd_rawmidi_ioctl_params_compat(struct snd_rawmidi_file *rfile, · 35 unmodified lines | |||
| 36 | struct snd_rawmidi_params params; | 36 | struct snd_rawmidi_params params; |
| 37 | unsigned int val; | 37 | unsigned int val; |
| 38 | 38 | ||
| 39 | if (rfile->output == NULL) | ||
| 40 | return -EINVAL; | ||
| 41 | if (get_user(params.stream, &src->stream) || | 39 | if (get_user(params.stream, &src->stream) || |
| 42 | get_user(params.buffer_size, &src->buffer_size) || | 40 | get_user(params.buffer_size, &src->buffer_size) || |
| 43 | get_user(params.avail_min, &src->avail_min) || | 41 | 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 | |||
| 46 | params.no_active_sensing = val; | 44 | params.no_active_sensing = val; |
| 47 | switch (params.stream) { | 45 | switch (params.stream) { |
| 48 | case SNDRV_RAWMIDI_STREAM_OUTPUT: | 46 | case SNDRV_RAWMIDI_STREAM_OUTPUT: |
| 47 | if (!rfile->output) | ||
| 48 | return -EINVAL; | ||
| 49 | return snd_rawmidi_output_params(rfile->output, ¶ms); | 49 | return snd_rawmidi_output_params(rfile->output, ¶ms); |
| 50 | case SNDRV_RAWMIDI_STREAM_INPUT: | 50 | case SNDRV_RAWMIDI_STREAM_INPUT: |
| 51 | if (!rfile->input) | ||
| 52 | return -EINVAL; | ||
| 51 | return snd_rawmidi_input_params(rfile->input, ¶ms); | 53 | return snd_rawmidi_input_params(rfile->input, ¶ms); |
| 52 | } | 54 | } |
| 53 | return -EINVAL; | 55 | return -EINVAL; |
| @@ -67,16 +69,18 @@ static int snd_rawmidi_ioctl_status_compat(struct snd_rawmidi_file *rfile, · 13 unmodified lines | |||
| 67 | int err; | 69 | int err; |
| 68 | struct snd_rawmidi_status status; | 70 | struct snd_rawmidi_status status; |
| 69 | 71 | ||
| 70 | if (rfile->output == NULL) | ||
| 71 | return -EINVAL; | ||
| 72 | if (get_user(status.stream, &src->stream)) | 72 | if (get_user(status.stream, &src->stream)) |
| 73 | return -EFAULT; | 73 | return -EFAULT; |
| 74 | 74 | ||
| 75 | switch (status.stream) { | 75 | switch (status.stream) { |
| 76 | case SNDRV_RAWMIDI_STREAM_OUTPUT: | 76 | case SNDRV_RAWMIDI_STREAM_OUTPUT: |
| 77 | if (!rfile->output) | ||
| 78 | return -EINVAL; | ||
| 77 | err = snd_rawmidi_output_status(rfile->output, &status); | 79 | err = snd_rawmidi_output_status(rfile->output, &status); |
| 78 | break; | 80 | break; |
| 79 | case SNDRV_RAWMIDI_STREAM_INPUT: | 81 | case SNDRV_RAWMIDI_STREAM_INPUT: |
| 82 | if (!rfile->input) | ||
| 83 | return -EINVAL; | ||
| 80 | err = snd_rawmidi_input_status(rfile->input, &status); | 84 | err = snd_rawmidi_input_status(rfile->input, &status); |
| 81 | break; | 85 | break; |
| 82 | default: | 86 | default: |
| @@ -112,16 +116,18 @@ static int snd_rawmidi_ioctl_status_x32(struct snd_rawmidi_file *rfile, · 29 unmodified lines | |||
| 112 | int err; | 116 | int err; |
| 113 | struct snd_rawmidi_status status; | 117 | struct snd_rawmidi_status status; |
| 114 | 118 | ||
| 115 | if (rfile->output == NULL) | ||
| 116 | return -EINVAL; | ||
| 117 | if (get_user(status.stream, &src->stream)) | 119 | if (get_user(status.stream, &src->stream)) |
| 118 | return -EFAULT; | 120 | return -EFAULT; |
| 119 | 121 | ||
| 120 | switch (status.stream) { | 122 | switch (status.stream) { |
| 121 | case SNDRV_RAWMIDI_STREAM_OUTPUT: | 123 | case SNDRV_RAWMIDI_STREAM_OUTPUT: |
| 124 | if (!rfile->output) | ||
| 125 | return -EINVAL; | ||
| 122 | err = snd_rawmidi_output_status(rfile->output, &status); | 126 | err = snd_rawmidi_output_status(rfile->output, &status); |
| 123 | break; | 127 | break; |
| 124 | case SNDRV_RAWMIDI_STREAM_INPUT: | 128 | case SNDRV_RAWMIDI_STREAM_INPUT: |
| 129 | if (!rfile->input) | ||
| 130 | return -EINVAL; | ||
| 125 | err = snd_rawmidi_input_status(rfile->input, &status); | 131 | err = snd_rawmidi_input_status(rfile->input, &status); |
| 126 | break; | 132 | break; |
| 127 | default: | 133 | default: |
| @@ -1647,7 +1647,8 @@ static void azx_check_snoop_available(struct azx *chip) · 1646 unmodified lines | |||
| 1647 | */ | 1647 | */ |
| 1648 | u8 val; | 1648 | u8 val; |
| 1649 | pci_read_config_byte(chip->pci, 0x42, &val); | 1649 | 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)) | ||
| 1651 | snoop = false; | 1652 | snoop = false; |
| 1652 | } | 1653 | } |
| 1653 | 1654 | ||
| @@ -6370,6 +6370,8 @@ static const struct hda_fixup alc269_fixups[] = { · 6369 unmodified lines | |||
| 6370 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | 6370 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6371 | { } | 6371 | { } |
| 6372 | }, | 6372 | }, |
| 6373 | .chained = true, | ||
| 6374 | .chain_id = ALC269_FIXUP_HEADSET_MIC | ||
| 6373 | }, | 6375 | }, |
| 6374 | }; | 6376 | }; |
| 6375 | 6377 | ||
| @@ -6573,6 +6575,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { · 197 unmodified lines | |||
| 6573 | SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY), | 6575 | SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY), |
| 6574 | SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY), | 6576 | SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY), |
| 6575 | SND_PCI_QUIRK(0x17aa, 0x310c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), | 6577 | 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), | ||
| 6576 | SND_PCI_QUIRK(0x17aa, 0x313c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), | 6579 | SND_PCI_QUIRK(0x17aa, 0x313c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), |
| 6577 | SND_PCI_QUIRK(0x17aa, 0x3112, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY), | 6580 | SND_PCI_QUIRK(0x17aa, 0x3112, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY), |
| 6578 | SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI), | 6581 | SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI), |
| @@ -125,7 +125,7 @@ static int send_midi_async(struct usb_line6 *line6, unsigned char *data, · 124 unmodified lines | |||
| 125 | } | 125 | } |
| 126 | 126 | ||
| 127 | usb_fill_int_urb(urb, line6->usbdev, | 127 | usb_fill_int_urb(urb, line6->usbdev, |
| 128 | usb_sndbulkpipe(line6->usbdev, | 128 | usb_sndintpipe(line6->usbdev, |
| 129 | line6->properties->ep_ctrl_w), | 129 | line6->properties->ep_ctrl_w), |
| 130 | transfer_buffer, length, midi_sent, line6, | 130 | transfer_buffer, length, midi_sent, line6, |
| 131 | line6->interval); | 131 | line6->interval); |