From b907900ec4065e1d9b65fafa05fd6601b6a2ffc7 Mon Sep 17 00:00:00 2001 From: Andrej Krutak Date: Wed, 5 Oct 2016 17:46:09 +0200 Subject: ALSA: line6: Fix POD X3 Live audio input The commit c039aaa77a7d1d9375665a8b59ec16dc7d23e259 was incomplete, missing part of the setup for Live. This makes also audio input work, in addition to audio output. Fixes: c039aaa77a7d1d9375665a8b59ec16dc7d23e259 Reported-by: Eddi De Pieri Signed-off-by: Andrej Krutak Signed-off-by: Takashi Iwai --- sound/usb/line6/podhd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sound/usb/line6/podhd.c b/sound/usb/line6/podhd.c index 9352a44ae6e4..49cd4a65e390 100644 --- a/sound/usb/line6/podhd.c +++ b/sound/usb/line6/podhd.c @@ -317,7 +317,8 @@ static int podhd_init(struct usb_line6 *line6, if (pod->line6.properties->capabilities & LINE6_CAP_PCM) { /* initialize PCM subsystem: */ err = line6_init_pcm(line6, - (id->driver_info == LINE6_PODX3) ? &podx3_pcm_properties : + (id->driver_info == LINE6_PODX3 || + id->driver_info == LINE6_PODX3LIVE) ? &podx3_pcm_properties : &podhd_pcm_properties); if (err < 0) return err; -- cgit v1.2.3 From 4875a5f7218068cdeea5f998330dfa3d118b2fea Mon Sep 17 00:00:00 2001 From: Hui Wang Date: Tue, 11 Oct 2016 10:48:58 +0800 Subject: ALSA: hda - Fix a failure of micmute led when having multi adcs On a Dell laptop, there is no global adcs for all input devices, so the input devices use the different adc, as a result, dyn_adc_switch is set to true. In this situation, it is safe to control the micmute led according to user's choice of muting/unmuting the current input device, since only current input device path is active, while other input device paths are inactive and powered down. Fixes: 00ef99408b6c ('ALSA: hda - add mic mute led hook for dell machines') Cc: Signed-off-by: Hui Wang Signed-off-by: Takashi Iwai --- sound/pci/hda/dell_wmi_helper.c | 2 +- sound/pci/hda/thinkpad_helper.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/pci/hda/dell_wmi_helper.c b/sound/pci/hda/dell_wmi_helper.c index 9c22f95838ef..19d41da79f93 100644 --- a/sound/pci/hda/dell_wmi_helper.c +++ b/sound/pci/hda/dell_wmi_helper.c @@ -49,7 +49,7 @@ static void alc_fixup_dell_wmi(struct hda_codec *codec, removefunc = true; if (dell_led_set_func(DELL_LED_MICMUTE, false) >= 0) { dell_led_value = 0; - if (spec->gen.num_adc_nids > 1) + if (spec->gen.num_adc_nids > 1 && !spec->gen.dyn_adc_switch) codec_dbg(codec, "Skipping micmute LED control due to several ADCs"); else { dell_old_cap_hook = spec->gen.cap_sync_hook; diff --git a/sound/pci/hda/thinkpad_helper.c b/sound/pci/hda/thinkpad_helper.c index f0955fd7a2e7..6a23302297c9 100644 --- a/sound/pci/hda/thinkpad_helper.c +++ b/sound/pci/hda/thinkpad_helper.c @@ -62,7 +62,7 @@ static void hda_fixup_thinkpad_acpi(struct hda_codec *codec, removefunc = false; } if (led_set_func(TPACPI_LED_MICMUTE, false) >= 0) { - if (spec->num_adc_nids > 1) + if (spec->num_adc_nids > 1 && !spec->dyn_adc_switch) codec_dbg(codec, "Skipping micmute LED control due to several ADCs"); else { -- cgit v1.2.3 From 30c0702246ac1ba955aa97d698610169242f59f1 Mon Sep 17 00:00:00 2001 From: Takashi Sakamoto Date: Wed, 12 Oct 2016 09:05:50 +0900 Subject: ALSA: seq: fix passing wrong pointer in function call of compatibility layer This commit is a fix for Linux 4.9-rc1. In former commit, a function call of compatibility layer for ALSA sequencer core was obsoleted by an alternative. Although, the alternative gets a pointer to kernel stack due to mis-programming. As a result, ALSA sequencer core unexpectedly refers over kernel stack. Reported-by: Dan Carpenter Fixes: 8ce8eb601c71 ("ALSA: seq: add an alternative way to handle ioctl requests") Signed-off-by: Takashi Sakamoto Signed-off-by: Takashi Iwai --- sound/core/seq/seq_compat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/core/seq/seq_compat.c b/sound/core/seq/seq_compat.c index fce5697e4261..8c3507216676 100644 --- a/sound/core/seq/seq_compat.c +++ b/sound/core/seq/seq_compat.c @@ -58,7 +58,7 @@ static int snd_seq_call_port_info_ioctl(struct snd_seq_client *client, unsigned goto error; data->kernel = NULL; - err = snd_seq_kernel_client_ctl(client->number, cmd, &data); + err = snd_seq_kernel_client_ctl(client->number, cmd, data); if (err < 0) goto error; -- cgit v1.2.3 From fdd8218d7d1bd0ccb9a3f4c58bf77773691a56cc Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Wed, 12 Oct 2016 09:21:40 +0300 Subject: ALSA: line6: fix a crash in line6_hwdep_write() The error checking here is messed up so we could end up dereferencing -EFAULT. Fixes: a16039cbf1a1 ('ALSA: line6: Add hwdep interface to access the POD control messages') Signed-off-by: Dan Carpenter Reviewed-by: Takashi Sakamoto Signed-off-by: Takashi Iwai --- sound/usb/line6/driver.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/usb/line6/driver.c b/sound/usb/line6/driver.c index 14e587e70655..90009c0b3a92 100644 --- a/sound/usb/line6/driver.c +++ b/sound/usb/line6/driver.c @@ -604,8 +604,8 @@ line6_hwdep_write(struct snd_hwdep *hwdep, const char __user *data, long count, } data_copy = memdup_user(data, count); - if (IS_ERR(ERR_PTR)) - return -ENOMEM; + if (IS_ERR(data_copy)) + return PTR_ERR(data_copy); rv = line6_send_raw_message(line6, data_copy, count); -- cgit v1.2.3