Skip to content

Commit 4f5d3da

Browse files
committed
Merge tag 'sound-6.13-rc6' of git://git.kernel.org/pub/scm/linux/kernel/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
2 parents 92c3bb3 + 8765429 commit 4f5d3da

File tree

7 files changed

+25
-12
lines changed

7 files changed

+25
-12
lines changed

sound/core/compress_offload.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1053,13 +1053,13 @@ static int snd_compr_task_new(struct snd_compr_stream *stream, struct snd_compr_
10531053
put_unused_fd(fd_i);
10541054
goto cleanup;
10551055
}
1056+
/* keep dmabuf reference until freed with task free ioctl */
1057+
get_dma_buf(task->input);
1058+
get_dma_buf(task->output);
10561059
fd_install(fd_i, task->input->file);
10571060
fd_install(fd_o, task->output->file);
10581061
utask->input_fd = fd_i;
10591062
utask->output_fd = fd_o;
1060-
/* keep dmabuf reference until freed with task free ioctl */
1061-
dma_buf_get(utask->input_fd);
1062-
dma_buf_get(utask->output_fd);
10631063
list_add_tail(&task->list, &stream->runtime->tasks);
10641064
stream->runtime->total_tasks++;
10651065
return 0;
@@ -1077,7 +1077,7 @@ static int snd_compr_task_create(struct snd_compr_stream *stream, unsigned long
10771077
return -EPERM;
10781078
task = memdup_user((void __user *)arg, sizeof(*task));
10791079
if (IS_ERR(task))
1080-
return PTR_ERR(no_free_ptr(task));
1080+
return PTR_ERR(task);
10811081
retval = snd_compr_task_new(stream, task);
10821082
if (retval >= 0)
10831083
if (copy_to_user((void __user *)arg, task, sizeof(*task)))
@@ -1138,7 +1138,7 @@ static int snd_compr_task_start_ioctl(struct snd_compr_stream *stream, unsigned
11381138
return -EPERM;
11391139
task = memdup_user((void __user *)arg, sizeof(*task));
11401140
if (IS_ERR(task))
1141-
return PTR_ERR(no_free_ptr(task));
1141+
return PTR_ERR(task);
11421142
retval = snd_compr_task_start(stream, task);
11431143
if (retval >= 0)
11441144
if (copy_to_user((void __user *)arg, task, sizeof(*task)))
@@ -1229,7 +1229,7 @@ static int snd_compr_task_status_ioctl(struct snd_compr_stream *stream, unsigned
12291229
return -EPERM;
12301230
status = memdup_user((void __user *)arg, sizeof(*status));
12311231
if (IS_ERR(status))
1232-
return PTR_ERR(no_free_ptr(status));
1232+
return PTR_ERR(status);
12331233
retval = snd_compr_task_status(stream, status);
12341234
if (retval >= 0)
12351235
if (copy_to_user((void __user *)arg, status, sizeof(*status)))

sound/core/seq/oss/seq_oss_synth.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ static struct seq_oss_synth midi_synth_dev = {
6666
};
6767

6868
static DEFINE_SPINLOCK(register_lock);
69+
static DEFINE_MUTEX(sysex_mutex);
6970

7071
/*
7172
* prototypes
@@ -497,6 +498,7 @@ snd_seq_oss_synth_sysex(struct seq_oss_devinfo *dp, int dev, unsigned char *buf,
497498
if (!info)
498499
return -ENXIO;
499500

501+
guard(mutex)(&sysex_mutex);
500502
sysex = info->sysex;
501503
if (sysex == NULL) {
502504
sysex = kzalloc(sizeof(*sysex), GFP_KERNEL);

sound/core/seq/seq_clientmgr.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1275,10 +1275,16 @@ static int snd_seq_ioctl_set_client_info(struct snd_seq_client *client,
12751275
if (client->type != client_info->type)
12761276
return -EINVAL;
12771277

1278-
/* check validity of midi_version field */
1279-
if (client->user_pversion >= SNDRV_PROTOCOL_VERSION(1, 0, 3) &&
1280-
client_info->midi_version > SNDRV_SEQ_CLIENT_UMP_MIDI_2_0)
1281-
return -EINVAL;
1278+
if (client->user_pversion >= SNDRV_PROTOCOL_VERSION(1, 0, 3)) {
1279+
/* check validity of midi_version field */
1280+
if (client_info->midi_version > SNDRV_SEQ_CLIENT_UMP_MIDI_2_0)
1281+
return -EINVAL;
1282+
1283+
/* check if UMP is supported in kernel */
1284+
if (!IS_ENABLED(CONFIG_SND_SEQ_UMP) &&
1285+
client_info->midi_version > 0)
1286+
return -EINVAL;
1287+
}
12821288

12831289
/* fill the info fields */
12841290
if (client_info->name[0])

sound/core/ump.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1244,7 +1244,7 @@ static int fill_legacy_mapping(struct snd_ump_endpoint *ump)
12441244

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

12501250
return num;

sound/pci/hda/patch_realtek.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11009,6 +11009,7 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
1100911009
SND_PCI_QUIRK(0xf111, 0x0001, "Framework Laptop", ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE),
1101011010
SND_PCI_QUIRK(0xf111, 0x0006, "Framework Laptop", ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE),
1101111011
SND_PCI_QUIRK(0xf111, 0x0009, "Framework Laptop", ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE),
11012+
SND_PCI_QUIRK(0xf111, 0x000c, "Framework Laptop", ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE),
1101211013

1101311014
#if 0
1101411015
/* Below is a quirk table taken from the old code.

sound/pci/hda/tas2781_hda_i2c.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,9 @@ static int tas2781_read_acpi(struct tasdevice_priv *p, const char *hid)
142142
}
143143
sub = acpi_get_subsystem_id(ACPI_HANDLE(physdev));
144144
if (IS_ERR(sub)) {
145+
/* No subsys id in older tas2563 projects. */
146+
if (!strncmp(hid, "INT8866", sizeof("INT8866")))
147+
goto end_2563;
145148
dev_err(p->dev, "Failed to get SUBSYS ID.\n");
146149
ret = PTR_ERR(sub);
147150
goto err;
@@ -164,6 +167,7 @@ static int tas2781_read_acpi(struct tasdevice_priv *p, const char *hid)
164167
p->speaker_id = NULL;
165168
}
166169

170+
end_2563:
167171
acpi_dev_free_resource_list(&resources);
168172
strscpy(p->dev_name, hid, sizeof(p->dev_name));
169173
put_device(physdev);

sound/usb/mixer_us16x08.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,7 @@ static int snd_us16x08_meter_get(struct snd_kcontrol *kcontrol,
687687
struct usb_mixer_elem_info *elem = kcontrol->private_data;
688688
struct snd_usb_audio *chip = elem->head.mixer->chip;
689689
struct snd_us16x08_meter_store *store = elem->private_data;
690-
u8 meter_urb[64];
690+
u8 meter_urb[64] = {0};
691691

692692
switch (kcontrol->private_value) {
693693
case 0: {

0 commit comments

Comments
 (0)