diff options
author | Sudip Mukherjee <sudipm.mukherjee@gmail.com> | 2015-12-01 16:09:51 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-05-10 10:26:06 +0200 |
commit | cbe76eacbb6e1661fb9728b33dc3534718946776 (patch) | |
tree | bb1ce5c759e4b05efb77cbf5dcb5c127a614654d /sound | |
parent | 9d1eedb8af659d87786110a2bb5199f165751334 (diff) | |
download | linux-stable-cbe76eacbb6e1661fb9728b33dc3534718946776.tar.gz linux-stable-cbe76eacbb6e1661fb9728b33dc3534718946776.tar.bz2 linux-stable-cbe76eacbb6e1661fb9728b33dc3534718946776.zip |
ASoC: tegra_alc5632: check return value
commit 319c32597fc22a58b946a6146f2be1fd208582e0 upstream.
We have been returning success even if snd_soc_card_jack_new() fails.
Lets check the return value and return error if it fails.
Fixes: 12cc6d1dca4d ("ASoC: tegra_alc5632: Register jacks at the card level")
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/tegra/tegra_alc5632.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/sound/soc/tegra/tegra_alc5632.c b/sound/soc/tegra/tegra_alc5632.c index ba272e21a6fa..deb597f7c302 100644 --- a/sound/soc/tegra/tegra_alc5632.c +++ b/sound/soc/tegra/tegra_alc5632.c @@ -101,12 +101,16 @@ static const struct snd_kcontrol_new tegra_alc5632_controls[] = { static int tegra_alc5632_asoc_init(struct snd_soc_pcm_runtime *rtd) { + int ret; struct tegra_alc5632 *machine = snd_soc_card_get_drvdata(rtd->card); - snd_soc_card_jack_new(rtd->card, "Headset Jack", SND_JACK_HEADSET, - &tegra_alc5632_hs_jack, - tegra_alc5632_hs_jack_pins, - ARRAY_SIZE(tegra_alc5632_hs_jack_pins)); + ret = snd_soc_card_jack_new(rtd->card, "Headset Jack", + SND_JACK_HEADSET, + &tegra_alc5632_hs_jack, + tegra_alc5632_hs_jack_pins, + ARRAY_SIZE(tegra_alc5632_hs_jack_pins)); + if (ret) + return ret; if (gpio_is_valid(machine->gpio_hp_det)) { tegra_alc5632_hp_jack_gpio.gpio = machine->gpio_hp_det; |