aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-11-02 10:45:48 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2017-11-02 10:45:48 -0400
commit0f07e10f8eebfd1081265f869cbb52a9d16e46f0 (patch)
tree32faacd1e9b33f3d356213f0e5d9534b297c38cf
parent6965f1aa7142a2989733c6ec53cc42ae97fd7f9d (diff)
parenta53a0ab8ff725672fcb47bb9a5ef75fce45679d0 (diff)
Merge tag 'sound-4.14-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound fixes from Takashi Iwai: "Unfortunately we still have received a significant amount of changes at the late stage, but at least all are small and clear fixes. There are two fixes for ALSA core stuff, yet another timer race fix and sequencer lockdep annotation fix. Both are spotted by syzkaller, and not too serious but better to paper over quickly. All other commits are about ASoC drivers, most notably, a revert of RT5514 hotword control that was included in 4.14-rc (due to a kind of abuse of kctl TLV ABI), together with topology API fixes and other device-specific small fixes that should go for stable, too" * tag 'sound-4.14-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: seq: Fix nested rwsem annotation for lockdep splat ALSA: timer: Add missing mutex lock for compat ioctls ASoC: rt5616: fix 0x91 default value ASoC: rt5659: connect LOUT Amp with Charge Pump ASoC: rt5659: register power bit of LOUT Amp ASoC: rt5663: Change the dev getting function in rt5663_irq ASoC: rt5514: Revert Hotword Model control ASoC: topology: Fix a potential memory leak in 'soc_tplg_dapm_widget_denum_create()' ASoC: topology: Fix a potential NULL pointer dereference in 'soc_tplg_dapm_widget_denum_create()' ASoC: rt5514-spi: check irq status to schedule data copy ASoC: adau17x1: Workaround for noise bug in ADC
-rw-r--r--sound/core/seq/seq_clientmgr.c2
-rw-r--r--sound/core/timer_compat.c17
-rw-r--r--sound/soc/codecs/adau17x1.c24
-rw-r--r--sound/soc/codecs/adau17x1.h2
-rw-r--r--sound/soc/codecs/rt5514-spi.c17
-rw-r--r--sound/soc/codecs/rt5514-spi.h3
-rw-r--r--sound/soc/codecs/rt5514.c63
-rw-r--r--sound/soc/codecs/rt5514.h3
-rw-r--r--sound/soc/codecs/rt5616.c2
-rw-r--r--sound/soc/codecs/rt5659.c4
-rw-r--r--sound/soc/codecs/rt5663.c3
-rw-r--r--sound/soc/soc-topology.c5
12 files changed, 69 insertions, 76 deletions
diff --git a/sound/core/seq/seq_clientmgr.c b/sound/core/seq/seq_clientmgr.c
index 6c9cba2166d9..d10c780dfd54 100644
--- a/sound/core/seq/seq_clientmgr.c
+++ b/sound/core/seq/seq_clientmgr.c
@@ -663,7 +663,7 @@ static int deliver_to_subscribers(struct snd_seq_client *client,
663 if (atomic) 663 if (atomic)
664 read_lock(&grp->list_lock); 664 read_lock(&grp->list_lock);
665 else 665 else
666 down_read(&grp->list_mutex); 666 down_read_nested(&grp->list_mutex, hop);
667 list_for_each_entry(subs, &grp->list_head, src_list) { 667 list_for_each_entry(subs, &grp->list_head, src_list) {
668 /* both ports ready? */ 668 /* both ports ready? */
669 if (atomic_read(&subs->ref_count) != 2) 669 if (atomic_read(&subs->ref_count) != 2)
diff --git a/sound/core/timer_compat.c b/sound/core/timer_compat.c
index 6a437eb66115..59127b6ef39e 100644
--- a/sound/core/timer_compat.c
+++ b/sound/core/timer_compat.c
@@ -133,7 +133,8 @@ enum {
133#endif /* CONFIG_X86_X32 */ 133#endif /* CONFIG_X86_X32 */
134}; 134};
135 135
136static long snd_timer_user_ioctl_compat(struct file *file, unsigned int cmd, unsigned long arg) 136static long __snd_timer_user_ioctl_compat(struct file *file, unsigned int cmd,
137 unsigned long arg)
137{ 138{
138 void __user *argp = compat_ptr(arg); 139 void __user *argp = compat_ptr(arg);
139 140
@@ -153,7 +154,7 @@ static long snd_timer_user_ioctl_compat(struct file *file, unsigned int cmd, uns
153 case SNDRV_TIMER_IOCTL_PAUSE: 154 case SNDRV_TIMER_IOCTL_PAUSE:
154 case SNDRV_TIMER_IOCTL_PAUSE_OLD: 155 case SNDRV_TIMER_IOCTL_PAUSE_OLD:
155 case SNDRV_TIMER_IOCTL_NEXT_DEVICE: 156 case SNDRV_TIMER_IOCTL_NEXT_DEVICE:
156 return snd_timer_user_ioctl(file, cmd, (unsigned long)argp); 157 return __snd_timer_user_ioctl(file, cmd, (unsigned long)argp);
157 case SNDRV_TIMER_IOCTL_GPARAMS32: 158 case SNDRV_TIMER_IOCTL_GPARAMS32:
158 return snd_timer_user_gparams_compat(file, argp); 159 return snd_timer_user_gparams_compat(file, argp);
159 case SNDRV_TIMER_IOCTL_INFO32: 160 case SNDRV_TIMER_IOCTL_INFO32:
@@ -167,3 +168,15 @@ static long snd_timer_user_ioctl_compat(struct file *file, unsigned int cmd, uns
167 } 168 }
168 return -ENOIOCTLCMD; 169 return -ENOIOCTLCMD;
169} 170}
171
172static long snd_timer_user_ioctl_compat(struct file *file, unsigned int cmd,
173 unsigned long arg)
174{
175 struct snd_timer_user *tu = file->private_data;
176 long ret;
177
178 mutex_lock(&tu->ioctl_lock);
179 ret = __snd_timer_user_ioctl_compat(file, cmd, arg);
180 mutex_unlock(&tu->ioctl_lock);
181 return ret;
182}
diff --git a/sound/soc/codecs/adau17x1.c b/sound/soc/codecs/adau17x1.c
index 2c1bd2763864..6758f789b712 100644
--- a/sound/soc/codecs/adau17x1.c
+++ b/sound/soc/codecs/adau17x1.c
@@ -90,6 +90,27 @@ static int adau17x1_pll_event(struct snd_soc_dapm_widget *w,
90 return 0; 90 return 0;
91} 91}
92 92
93static int adau17x1_adc_fixup(struct snd_soc_dapm_widget *w,
94 struct snd_kcontrol *kcontrol, int event)
95{
96 struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm);
97 struct adau *adau = snd_soc_codec_get_drvdata(codec);
98
99 /*
100 * If we are capturing, toggle the ADOSR bit in Converter Control 0 to
101 * avoid losing SNR (workaround from ADI). This must be done after
102 * the ADC(s) have been enabled. According to the data sheet, it is
103 * normally illegal to set this bit when the sampling rate is 96 kHz,
104 * but according to ADI it is acceptable for this workaround.
105 */
106 regmap_update_bits(adau->regmap, ADAU17X1_CONVERTER0,
107 ADAU17X1_CONVERTER0_ADOSR, ADAU17X1_CONVERTER0_ADOSR);
108 regmap_update_bits(adau->regmap, ADAU17X1_CONVERTER0,
109 ADAU17X1_CONVERTER0_ADOSR, 0);
110
111 return 0;
112}
113
93static const char * const adau17x1_mono_stereo_text[] = { 114static const char * const adau17x1_mono_stereo_text[] = {
94 "Stereo", 115 "Stereo",
95 "Mono Left Channel (L+R)", 116 "Mono Left Channel (L+R)",
@@ -121,7 +142,8 @@ static const struct snd_soc_dapm_widget adau17x1_dapm_widgets[] = {
121 SND_SOC_DAPM_MUX("Right DAC Mode Mux", SND_SOC_NOPM, 0, 0, 142 SND_SOC_DAPM_MUX("Right DAC Mode Mux", SND_SOC_NOPM, 0, 0,
122 &adau17x1_dac_mode_mux), 143 &adau17x1_dac_mode_mux),
123 144
124 SND_SOC_DAPM_ADC("Left Decimator", NULL, ADAU17X1_ADC_CONTROL, 0, 0), 145 SND_SOC_DAPM_ADC_E("Left Decimator", NULL, ADAU17X1_ADC_CONTROL, 0, 0,
146 adau17x1_adc_fixup, SND_SOC_DAPM_POST_PMU),
125 SND_SOC_DAPM_ADC("Right Decimator", NULL, ADAU17X1_ADC_CONTROL, 1, 0), 147 SND_SOC_DAPM_ADC("Right Decimator", NULL, ADAU17X1_ADC_CONTROL, 1, 0),
126 SND_SOC_DAPM_DAC("Left DAC", NULL, ADAU17X1_DAC_CONTROL0, 0, 0), 148 SND_SOC_DAPM_DAC("Left DAC", NULL, ADAU17X1_DAC_CONTROL0, 0, 0),
127 SND_SOC_DAPM_DAC("Right DAC", NULL, ADAU17X1_DAC_CONTROL0, 1, 0), 149 SND_SOC_DAPM_DAC("Right DAC", NULL, ADAU17X1_DAC_CONTROL0, 1, 0),
diff --git a/sound/soc/codecs/adau17x1.h b/sound/soc/codecs/adau17x1.h
index bf04b7efee40..db350035fad7 100644
--- a/sound/soc/codecs/adau17x1.h
+++ b/sound/soc/codecs/adau17x1.h
@@ -129,5 +129,7 @@ bool adau17x1_has_dsp(struct adau *adau);
129 129
130#define ADAU17X1_CONVERTER0_CONVSR_MASK 0x7 130#define ADAU17X1_CONVERTER0_CONVSR_MASK 0x7
131 131
132#define ADAU17X1_CONVERTER0_ADOSR BIT(3)
133
132 134
133#endif 135#endif
diff --git a/sound/soc/codecs/rt5514-spi.c b/sound/soc/codecs/rt5514-spi.c
index ed6e5373916c..12f2ecf3a4fe 100644
--- a/sound/soc/codecs/rt5514-spi.c
+++ b/sound/soc/codecs/rt5514-spi.c
@@ -145,9 +145,8 @@ done:
145 mutex_unlock(&rt5514_dsp->dma_lock); 145 mutex_unlock(&rt5514_dsp->dma_lock);
146} 146}
147 147
148static irqreturn_t rt5514_spi_irq(int irq, void *data) 148static void rt5514_schedule_copy(struct rt5514_dsp *rt5514_dsp)
149{ 149{
150 struct rt5514_dsp *rt5514_dsp = data;
151 u8 buf[8]; 150 u8 buf[8];
152 151
153 rt5514_dsp->get_size = 0; 152 rt5514_dsp->get_size = 0;
@@ -180,6 +179,13 @@ static irqreturn_t rt5514_spi_irq(int irq, void *data)
180 if (rt5514_dsp->buf_base && rt5514_dsp->buf_limit && 179 if (rt5514_dsp->buf_base && rt5514_dsp->buf_limit &&
181 rt5514_dsp->buf_rp && rt5514_dsp->buf_size) 180 rt5514_dsp->buf_rp && rt5514_dsp->buf_size)
182 schedule_delayed_work(&rt5514_dsp->copy_work, 0); 181 schedule_delayed_work(&rt5514_dsp->copy_work, 0);
182}
183
184static irqreturn_t rt5514_spi_irq(int irq, void *data)
185{
186 struct rt5514_dsp *rt5514_dsp = data;
187
188 rt5514_schedule_copy(rt5514_dsp);
183 189
184 return IRQ_HANDLED; 190 return IRQ_HANDLED;
185} 191}
@@ -199,12 +205,19 @@ static int rt5514_spi_hw_params(struct snd_pcm_substream *substream,
199 struct rt5514_dsp *rt5514_dsp = 205 struct rt5514_dsp *rt5514_dsp =
200 snd_soc_platform_get_drvdata(rtd->platform); 206 snd_soc_platform_get_drvdata(rtd->platform);
201 int ret; 207 int ret;
208 u8 buf[8];
202 209
203 mutex_lock(&rt5514_dsp->dma_lock); 210 mutex_lock(&rt5514_dsp->dma_lock);
204 ret = snd_pcm_lib_alloc_vmalloc_buffer(substream, 211 ret = snd_pcm_lib_alloc_vmalloc_buffer(substream,
205 params_buffer_bytes(hw_params)); 212 params_buffer_bytes(hw_params));
206 rt5514_dsp->substream = substream; 213 rt5514_dsp->substream = substream;
207 rt5514_dsp->dma_offset = 0; 214 rt5514_dsp->dma_offset = 0;
215
216 /* Read IRQ status and schedule copy accordingly. */
217 rt5514_spi_burst_read(RT5514_IRQ_CTRL, (u8 *)&buf, sizeof(buf));
218 if (buf[0] & RT5514_IRQ_STATUS_BIT)
219 rt5514_schedule_copy(rt5514_dsp);
220
208 mutex_unlock(&rt5514_dsp->dma_lock); 221 mutex_unlock(&rt5514_dsp->dma_lock);
209 222
210 return ret; 223 return ret;
diff --git a/sound/soc/codecs/rt5514-spi.h b/sound/soc/codecs/rt5514-spi.h
index a6434ee6ff03..c1a36647c119 100644
--- a/sound/soc/codecs/rt5514-spi.h
+++ b/sound/soc/codecs/rt5514-spi.h
@@ -20,6 +20,9 @@
20#define RT5514_BUFFER_VOICE_BASE 0x18000200 20#define RT5514_BUFFER_VOICE_BASE 0x18000200
21#define RT5514_BUFFER_VOICE_LIMIT 0x18000204 21#define RT5514_BUFFER_VOICE_LIMIT 0x18000204
22#define RT5514_BUFFER_VOICE_WP 0x1800020c 22#define RT5514_BUFFER_VOICE_WP 0x1800020c
23#define RT5514_IRQ_CTRL 0x18002094
24
25#define RT5514_IRQ_STATUS_BIT (0x1 << 5)
23 26
24/* SPI Command */ 27/* SPI Command */
25enum { 28enum {
diff --git a/sound/soc/codecs/rt5514.c b/sound/soc/codecs/rt5514.c
index 0945d212b8dc..d7956ababd11 100644
--- a/sound/soc/codecs/rt5514.c
+++ b/sound/soc/codecs/rt5514.c
@@ -338,39 +338,6 @@ static int rt5514_dsp_voice_wake_up_put(struct snd_kcontrol *kcontrol,
338 fw = NULL; 338 fw = NULL;
339 } 339 }
340 340
341 if (rt5514->model_buf && rt5514->model_len) {
342#if IS_ENABLED(CONFIG_SND_SOC_RT5514_SPI)
343 int ret;
344
345 ret = rt5514_spi_burst_write(0x4ff80000,
346 rt5514->model_buf,
347 ((rt5514->model_len / 8) + 1) * 8);
348 if (ret) {
349 dev_err(codec->dev,
350 "Model load failed %d\n", ret);
351 return ret;
352 }
353#else
354 dev_err(codec->dev,
355 "No SPI driver for loading firmware\n");
356#endif
357 } else {
358 request_firmware(&fw, RT5514_FIRMWARE3,
359 codec->dev);
360 if (fw) {
361#if IS_ENABLED(CONFIG_SND_SOC_RT5514_SPI)
362 rt5514_spi_burst_write(0x4ff80000,
363 fw->data,
364 ((fw->size/8)+1)*8);
365#else
366 dev_err(codec->dev,
367 "No SPI driver to load fw\n");
368#endif
369 release_firmware(fw);
370 fw = NULL;
371 }
372 }
373
374 /* DSP run */ 341 /* DSP run */
375 regmap_write(rt5514->i2c_regmap, 0x18002f00, 342 regmap_write(rt5514->i2c_regmap, 0x18002f00,
376 0x00055148); 343 0x00055148);
@@ -385,34 +352,6 @@ static int rt5514_dsp_voice_wake_up_put(struct snd_kcontrol *kcontrol,
385 return 0; 352 return 0;
386} 353}
387 354
388static int rt5514_hotword_model_put(struct snd_kcontrol *kcontrol,
389 const unsigned int __user *bytes, unsigned int size)
390{
391 struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
392 struct rt5514_priv *rt5514 = snd_soc_component_get_drvdata(component);
393 struct snd_soc_codec *codec = rt5514->codec;
394 int ret = 0;
395
396 if (rt5514->model_buf || rt5514->model_len < size) {
397 if (rt5514->model_buf)
398 devm_kfree(codec->dev, rt5514->model_buf);
399 rt5514->model_buf = devm_kmalloc(codec->dev, size, GFP_KERNEL);
400 if (!rt5514->model_buf) {
401 ret = -ENOMEM;
402 goto done;
403 }
404 }
405
406 /* Skips the TLV header. */
407 bytes += 2;
408
409 if (copy_from_user(rt5514->model_buf, bytes, size))
410 ret = -EFAULT;
411done:
412 rt5514->model_len = (ret ? 0 : size);
413 return ret;
414}
415
416static const struct snd_kcontrol_new rt5514_snd_controls[] = { 355static const struct snd_kcontrol_new rt5514_snd_controls[] = {
417 SOC_DOUBLE_TLV("MIC Boost Volume", RT5514_ANA_CTRL_MICBST, 356 SOC_DOUBLE_TLV("MIC Boost Volume", RT5514_ANA_CTRL_MICBST,
418 RT5514_SEL_BSTL_SFT, RT5514_SEL_BSTR_SFT, 8, 0, bst_tlv), 357 RT5514_SEL_BSTL_SFT, RT5514_SEL_BSTR_SFT, 8, 0, bst_tlv),
@@ -424,8 +363,6 @@ static const struct snd_kcontrol_new rt5514_snd_controls[] = {
424 adc_vol_tlv), 363 adc_vol_tlv),
425 SOC_SINGLE_EXT("DSP Voice Wake Up", SND_SOC_NOPM, 0, 1, 0, 364 SOC_SINGLE_EXT("DSP Voice Wake Up", SND_SOC_NOPM, 0, 1, 0,
426 rt5514_dsp_voice_wake_up_get, rt5514_dsp_voice_wake_up_put), 365 rt5514_dsp_voice_wake_up_get, rt5514_dsp_voice_wake_up_put),
427 SND_SOC_BYTES_TLV("Hotword Model", 0x8504,
428 NULL, rt5514_hotword_model_put),
429}; 366};
430 367
431/* ADC Mixer*/ 368/* ADC Mixer*/
diff --git a/sound/soc/codecs/rt5514.h b/sound/soc/codecs/rt5514.h
index 803311cb7e2a..2dc40e6d8b3f 100644
--- a/sound/soc/codecs/rt5514.h
+++ b/sound/soc/codecs/rt5514.h
@@ -255,7 +255,6 @@
255 255
256#define RT5514_FIRMWARE1 "rt5514_dsp_fw1.bin" 256#define RT5514_FIRMWARE1 "rt5514_dsp_fw1.bin"
257#define RT5514_FIRMWARE2 "rt5514_dsp_fw2.bin" 257#define RT5514_FIRMWARE2 "rt5514_dsp_fw2.bin"
258#define RT5514_FIRMWARE3 "rt5514_dsp_fw3.bin"
259 258
260/* System Clock Source */ 259/* System Clock Source */
261enum { 260enum {
@@ -282,8 +281,6 @@ struct rt5514_priv {
282 int pll_in; 281 int pll_in;
283 int pll_out; 282 int pll_out;
284 int dsp_enabled; 283 int dsp_enabled;
285 u8 *model_buf;
286 unsigned int model_len;
287}; 284};
288 285
289#endif /* __RT5514_H__ */ 286#endif /* __RT5514_H__ */
diff --git a/sound/soc/codecs/rt5616.c b/sound/soc/codecs/rt5616.c
index c94e94fe8297..0e5f54a9bc7e 100644
--- a/sound/soc/codecs/rt5616.c
+++ b/sound/soc/codecs/rt5616.c
@@ -98,7 +98,7 @@ static const struct reg_default rt5616_reg[] = {
98 { 0x8e, 0x0004 }, 98 { 0x8e, 0x0004 },
99 { 0x8f, 0x1100 }, 99 { 0x8f, 0x1100 },
100 { 0x90, 0x0000 }, 100 { 0x90, 0x0000 },
101 { 0x91, 0x0000 }, 101 { 0x91, 0x0c00 },
102 { 0x92, 0x0000 }, 102 { 0x92, 0x0000 },
103 { 0x93, 0x2000 }, 103 { 0x93, 0x2000 },
104 { 0x94, 0x0200 }, 104 { 0x94, 0x0200 },
diff --git a/sound/soc/codecs/rt5659.c b/sound/soc/codecs/rt5659.c
index 71216db15eab..fa66b11df8d4 100644
--- a/sound/soc/codecs/rt5659.c
+++ b/sound/soc/codecs/rt5659.c
@@ -2744,7 +2744,8 @@ static const struct snd_soc_dapm_widget rt5659_dapm_widgets[] = {
2744 SND_SOC_DAPM_PRE_PMU), 2744 SND_SOC_DAPM_PRE_PMU),
2745 SND_SOC_DAPM_PGA_S("HP Amp", 1, SND_SOC_NOPM, 0, 0, rt5659_hp_event, 2745 SND_SOC_DAPM_PGA_S("HP Amp", 1, SND_SOC_NOPM, 0, 0, rt5659_hp_event,
2746 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU), 2746 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU),
2747 SND_SOC_DAPM_PGA("LOUT Amp", SND_SOC_NOPM, 0, 0, NULL, 0), 2747 SND_SOC_DAPM_PGA_S("LOUT Amp", 1, RT5659_PWR_ANLG_1, RT5659_PWR_LM_BIT,
2748 0, NULL, 0),
2748 2749
2749 SND_SOC_DAPM_SUPPLY("Charge Pump", SND_SOC_NOPM, 0, 0, 2750 SND_SOC_DAPM_SUPPLY("Charge Pump", SND_SOC_NOPM, 0, 0,
2750 rt5659_charge_pump_event, SND_SOC_DAPM_PRE_PMU | 2751 rt5659_charge_pump_event, SND_SOC_DAPM_PRE_PMU |
@@ -3208,6 +3209,7 @@ static const struct snd_soc_dapm_route rt5659_dapm_routes[] = {
3208 { "LOUT R MIX", "OUTVOL R Switch", "OUTVOL R" }, 3209 { "LOUT R MIX", "OUTVOL R Switch", "OUTVOL R" },
3209 { "LOUT Amp", NULL, "LOUT L MIX" }, 3210 { "LOUT Amp", NULL, "LOUT L MIX" },
3210 { "LOUT Amp", NULL, "LOUT R MIX" }, 3211 { "LOUT Amp", NULL, "LOUT R MIX" },
3212 { "LOUT Amp", NULL, "Charge Pump" },
3211 { "LOUT Amp", NULL, "SYS CLK DET" }, 3213 { "LOUT Amp", NULL, "SYS CLK DET" },
3212 { "LOUT L Playback", "Switch", "LOUT Amp" }, 3214 { "LOUT L Playback", "Switch", "LOUT Amp" },
3213 { "LOUT R Playback", "Switch", "LOUT Amp" }, 3215 { "LOUT R Playback", "Switch", "LOUT Amp" },
diff --git a/sound/soc/codecs/rt5663.c b/sound/soc/codecs/rt5663.c
index ab9e0ebff5a7..e45b895d8279 100644
--- a/sound/soc/codecs/rt5663.c
+++ b/sound/soc/codecs/rt5663.c
@@ -1639,7 +1639,8 @@ static irqreturn_t rt5663_irq(int irq, void *data)
1639{ 1639{
1640 struct rt5663_priv *rt5663 = data; 1640 struct rt5663_priv *rt5663 = data;
1641 1641
1642 dev_dbg(rt5663->codec->dev, "%s IRQ queue work\n", __func__); 1642 dev_dbg(regmap_get_device(rt5663->regmap), "%s IRQ queue work\n",
1643 __func__);
1643 1644
1644 queue_delayed_work(system_wq, &rt5663->jack_detect_work, 1645 queue_delayed_work(system_wq, &rt5663->jack_detect_work,
1645 msecs_to_jiffies(250)); 1646 msecs_to_jiffies(250));
diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c
index dd471d2c0266..01a50413c66f 100644
--- a/sound/soc/soc-topology.c
+++ b/sound/soc/soc-topology.c
@@ -1301,7 +1301,7 @@ static struct snd_kcontrol_new *soc_tplg_dapm_widget_denum_create(
1301 /* validate kcontrol */ 1301 /* validate kcontrol */
1302 if (strnlen(ec->hdr.name, SNDRV_CTL_ELEM_ID_NAME_MAXLEN) == 1302 if (strnlen(ec->hdr.name, SNDRV_CTL_ELEM_ID_NAME_MAXLEN) ==
1303 SNDRV_CTL_ELEM_ID_NAME_MAXLEN) 1303 SNDRV_CTL_ELEM_ID_NAME_MAXLEN)
1304 return NULL; 1304 goto err;
1305 1305
1306 se = kzalloc(sizeof(*se), GFP_KERNEL); 1306 se = kzalloc(sizeof(*se), GFP_KERNEL);
1307 if (se == NULL) 1307 if (se == NULL)
@@ -1378,6 +1378,9 @@ err_se:
1378 for (; i >= 0; i--) { 1378 for (; i >= 0; i--) {
1379 /* free values and texts */ 1379 /* free values and texts */
1380 se = (struct soc_enum *)kc[i].private_value; 1380 se = (struct soc_enum *)kc[i].private_value;
1381 if (!se)
1382 continue;
1383
1381 kfree(se->dobj.control.dvalues); 1384 kfree(se->dobj.control.dvalues);
1382 for (j = 0; j < ec->items; j++) 1385 for (j = 0; j < ec->items; j++)
1383 kfree(se->dobj.control.dtexts[j]); 1386 kfree(se->dobj.control.dtexts[j]);