Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cb247857 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull sound fixes from Takashi Iwai:
 "A collection of small fixes, mostly for regression fixes (sequencer
  kconfig and emu10k1 probe) and device-specific quirks (three for USB
  and one for HD-audio).

  One significant change is a fix for races in ALSA sequencer core,
  which covers over the previous incomplete fix"

* tag 'sound-4.13-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ALSA: emu10k1: Fix forgotten user-copy conversion in init code
  ALSA: usb-audio: add DSD support for new Amanero PID
  ALSA: usb-audio: Add mute TLV for playback volumes on C-Media devices
  ALSA: usb-audio: Apply sample rate quirk to Sennheiser headset
  ALSA: seq: 2nd attempt at fixing race creating a queue
  ALSA: hda/realtek - Fix pincfg for Dell XPS 13 9370
  ALSA: seq: Fix CONFIG_SND_SEQ_MIDI dependency
parents 4478976a 0b36f2bd
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -47,10 +47,10 @@ config SND_SEQ_HRTIMER_DEFAULT
	  timer.

config SND_SEQ_MIDI_EVENT
	def_tristate SND_RAWMIDI
	tristate

config SND_SEQ_MIDI
	tristate
	def_tristate SND_RAWMIDI
	select SND_SEQ_MIDI_EVENT

config SND_SEQ_MIDI_EMUL
+4 −9
Original line number Diff line number Diff line
@@ -1502,16 +1502,11 @@ static int snd_seq_ioctl_unsubscribe_port(struct snd_seq_client *client,
static int snd_seq_ioctl_create_queue(struct snd_seq_client *client, void *arg)
{
	struct snd_seq_queue_info *info = arg;
	int result;
	struct snd_seq_queue *q;

	result = snd_seq_queue_alloc(client->number, info->locked, info->flags);
	if (result < 0)
		return result;

	q = queueptr(result);
	if (q == NULL)
		return -EINVAL;
	q = snd_seq_queue_alloc(client->number, info->locked, info->flags);
	if (IS_ERR(q))
		return PTR_ERR(q);

	info->queue = q->queue;
	info->locked = q->locked;
@@ -1521,7 +1516,7 @@ static int snd_seq_ioctl_create_queue(struct snd_seq_client *client, void *arg)
	if (!info->name[0])
		snprintf(info->name, sizeof(info->name), "Queue-%d", q->queue);
	strlcpy(q->name, info->name, sizeof(q->name));
	queuefree(q);
	snd_use_lock_free(&q->use_lock);

	return 0;
}
+9 −5
Original line number Diff line number Diff line
@@ -184,22 +184,26 @@ void __exit snd_seq_queues_delete(void)
static void queue_use(struct snd_seq_queue *queue, int client, int use);

/* allocate a new queue -
 * return queue index value or negative value for error
 * return pointer to new queue or ERR_PTR(-errno) for error
 * The new queue's use_lock is set to 1. It is the caller's responsibility to
 * call snd_use_lock_free(&q->use_lock).
 */
int snd_seq_queue_alloc(int client, int locked, unsigned int info_flags)
struct snd_seq_queue *snd_seq_queue_alloc(int client, int locked, unsigned int info_flags)
{
	struct snd_seq_queue *q;

	q = queue_new(client, locked);
	if (q == NULL)
		return -ENOMEM;
		return ERR_PTR(-ENOMEM);
	q->info_flags = info_flags;
	queue_use(q, client, 1);
	snd_use_lock_use(&q->use_lock);
	if (queue_list_add(q) < 0) {
		snd_use_lock_free(&q->use_lock);
		queue_delete(q);
		return -ENOMEM;
		return ERR_PTR(-ENOMEM);
	}
	return q->queue;
	return q;
}

/* delete a queue - queue must be owned by the client */
+1 −1
Original line number Diff line number Diff line
@@ -71,7 +71,7 @@ void snd_seq_queues_delete(void);


/* create new queue (constructor) */
int snd_seq_queue_alloc(int client, int locked, unsigned int flags);
struct snd_seq_queue *snd_seq_queue_alloc(int client, int locked, unsigned int flags);

/* delete queue (destructor) */
int snd_seq_queue_delete(int client, int queueid);
+11 −3
Original line number Diff line number Diff line
@@ -698,10 +698,18 @@ static int copy_gctl(struct snd_emu10k1 *emu,
{
	struct snd_emu10k1_fx8010_control_old_gpr __user *octl;

	if (emu->support_tlv)
		return copy_from_user(gctl, &_gctl[idx], sizeof(*gctl));
	if (emu->support_tlv) {
		if (in_kernel)
			memcpy(gctl, (void *)&_gctl[idx], sizeof(*gctl));
		else if (copy_from_user(gctl, &_gctl[idx], sizeof(*gctl)))
			return -EFAULT;
		return 0;
	}

	octl = (struct snd_emu10k1_fx8010_control_old_gpr __user *)_gctl;
	if (copy_from_user(gctl, &octl[idx], sizeof(*octl)))
	if (in_kernel)
		memcpy(gctl, (void *)&octl[idx], sizeof(*octl));
	else if (copy_from_user(gctl, &octl[idx], sizeof(*octl)))
		return -EFAULT;
	gctl->tlv = NULL;
	return 0;
Loading