Skip to content

Commit

Permalink
Merge tag 'sound-6.13-rc6' of git://git.kernel.org/pub/scm/linux/kern…
Browse files Browse the repository at this point in the history
…el/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
 "The first new year pull request: no surprises, all small fixes,
  including:

   - Follow-up fixes for the new compress-offload API extension

   - A couple of fixes for MIDI 2.0 UMP handling

   - A trivial race fix for OSS sequencer emulation ioctls

   - USB-audio and HD-audio fixes / quirks"

* tag 'sound-6.13-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ALSA: seq: Check UMP support for midi_version change
  ALSA hda/realtek: Add quirk for Framework F111:000C
  Revert "ALSA: ump: Don't enumeration invalid groups for legacy rawmidi"
  ALSA: seq: oss: Fix races at processing SysEx messages
  ALSA: compress_offload: fix remaining descriptor races in sound/core/compress_offload.c
  ALSA: compress_offload: Drop unneeded no_free_ptr()
  ALSA: hda/tas2781: Ignore SUBSYS_ID not found for tas2563 projects
  ALSA: usb-audio: US16x08: Initialize array before use
  • Loading branch information
torvalds committed Jan 3, 2025
2 parents 92c3bb3 + 8765429 commit 4f5d3da
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 12 deletions.
12 changes: 6 additions & 6 deletions sound/core/compress_offload.c
Original file line number Diff line number Diff line change
Expand Up @@ -1053,13 +1053,13 @@ static int snd_compr_task_new(struct snd_compr_stream *stream, struct snd_compr_
put_unused_fd(fd_i);
goto cleanup;
}
/* keep dmabuf reference until freed with task free ioctl */
get_dma_buf(task->input);
get_dma_buf(task->output);
fd_install(fd_i, task->input->file);
fd_install(fd_o, task->output->file);
utask->input_fd = fd_i;
utask->output_fd = fd_o;
/* keep dmabuf reference until freed with task free ioctl */
dma_buf_get(utask->input_fd);
dma_buf_get(utask->output_fd);
list_add_tail(&task->list, &stream->runtime->tasks);
stream->runtime->total_tasks++;
return 0;
Expand All @@ -1077,7 +1077,7 @@ static int snd_compr_task_create(struct snd_compr_stream *stream, unsigned long
return -EPERM;
task = memdup_user((void __user *)arg, sizeof(*task));
if (IS_ERR(task))
return PTR_ERR(no_free_ptr(task));
return PTR_ERR(task);
retval = snd_compr_task_new(stream, task);
if (retval >= 0)
if (copy_to_user((void __user *)arg, task, sizeof(*task)))
Expand Down Expand Up @@ -1138,7 +1138,7 @@ static int snd_compr_task_start_ioctl(struct snd_compr_stream *stream, unsigned
return -EPERM;
task = memdup_user((void __user *)arg, sizeof(*task));
if (IS_ERR(task))
return PTR_ERR(no_free_ptr(task));
return PTR_ERR(task);
retval = snd_compr_task_start(stream, task);
if (retval >= 0)
if (copy_to_user((void __user *)arg, task, sizeof(*task)))
Expand Down Expand Up @@ -1229,7 +1229,7 @@ static int snd_compr_task_status_ioctl(struct snd_compr_stream *stream, unsigned
return -EPERM;
status = memdup_user((void __user *)arg, sizeof(*status));
if (IS_ERR(status))
return PTR_ERR(no_free_ptr(status));
return PTR_ERR(status);
retval = snd_compr_task_status(stream, status);
if (retval >= 0)
if (copy_to_user((void __user *)arg, status, sizeof(*status)))
Expand Down
2 changes: 2 additions & 0 deletions sound/core/seq/oss/seq_oss_synth.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ static struct seq_oss_synth midi_synth_dev = {
};

static DEFINE_SPINLOCK(register_lock);
static DEFINE_MUTEX(sysex_mutex);

/*
* prototypes
Expand Down Expand Up @@ -497,6 +498,7 @@ snd_seq_oss_synth_sysex(struct seq_oss_devinfo *dp, int dev, unsigned char *buf,
if (!info)
return -ENXIO;

guard(mutex)(&sysex_mutex);
sysex = info->sysex;
if (sysex == NULL) {
sysex = kzalloc(sizeof(*sysex), GFP_KERNEL);
Expand Down
14 changes: 10 additions & 4 deletions sound/core/seq/seq_clientmgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1275,10 +1275,16 @@ static int snd_seq_ioctl_set_client_info(struct snd_seq_client *client,
if (client->type != client_info->type)
return -EINVAL;

/* check validity of midi_version field */
if (client->user_pversion >= SNDRV_PROTOCOL_VERSION(1, 0, 3) &&
client_info->midi_version > SNDRV_SEQ_CLIENT_UMP_MIDI_2_0)
return -EINVAL;
if (client->user_pversion >= SNDRV_PROTOCOL_VERSION(1, 0, 3)) {
/* check validity of midi_version field */
if (client_info->midi_version > SNDRV_SEQ_CLIENT_UMP_MIDI_2_0)
return -EINVAL;

/* check if UMP is supported in kernel */
if (!IS_ENABLED(CONFIG_SND_SEQ_UMP) &&
client_info->midi_version > 0)
return -EINVAL;
}

/* fill the info fields */
if (client_info->name[0])
Expand Down
2 changes: 1 addition & 1 deletion sound/core/ump.c
Original file line number Diff line number Diff line change
Expand Up @@ -1244,7 +1244,7 @@ static int fill_legacy_mapping(struct snd_ump_endpoint *ump)

num = 0;
for (i = 0; i < SNDRV_UMP_MAX_GROUPS; i++)
if ((group_maps & (1U << i)) && ump->groups[i].valid)
if (group_maps & (1U << i))
ump->legacy_mapping[num++] = i;

return num;
Expand Down
1 change: 1 addition & 0 deletions sound/pci/hda/patch_realtek.c
Original file line number Diff line number Diff line change
Expand Up @@ -11009,6 +11009,7 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
SND_PCI_QUIRK(0xf111, 0x0001, "Framework Laptop", ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE),
SND_PCI_QUIRK(0xf111, 0x0006, "Framework Laptop", ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE),
SND_PCI_QUIRK(0xf111, 0x0009, "Framework Laptop", ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE),
SND_PCI_QUIRK(0xf111, 0x000c, "Framework Laptop", ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE),

#if 0
/* Below is a quirk table taken from the old code.
Expand Down
4 changes: 4 additions & 0 deletions sound/pci/hda/tas2781_hda_i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@ static int tas2781_read_acpi(struct tasdevice_priv *p, const char *hid)
}
sub = acpi_get_subsystem_id(ACPI_HANDLE(physdev));
if (IS_ERR(sub)) {
/* No subsys id in older tas2563 projects. */
if (!strncmp(hid, "INT8866", sizeof("INT8866")))
goto end_2563;
dev_err(p->dev, "Failed to get SUBSYS ID.\n");
ret = PTR_ERR(sub);
goto err;
Expand All @@ -164,6 +167,7 @@ static int tas2781_read_acpi(struct tasdevice_priv *p, const char *hid)
p->speaker_id = NULL;
}

end_2563:
acpi_dev_free_resource_list(&resources);
strscpy(p->dev_name, hid, sizeof(p->dev_name));
put_device(physdev);
Expand Down
2 changes: 1 addition & 1 deletion sound/usb/mixer_us16x08.c
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ static int snd_us16x08_meter_get(struct snd_kcontrol *kcontrol,
struct usb_mixer_elem_info *elem = kcontrol->private_data;
struct snd_usb_audio *chip = elem->head.mixer->chip;
struct snd_us16x08_meter_store *store = elem->private_data;
u8 meter_urb[64];
u8 meter_urb[64] = {0};

switch (kcontrol->private_value) {
case 0: {
Expand Down

0 comments on commit 4f5d3da

Please sign in to comment.