diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2017-01-20 08:07:52 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2017-01-20 08:11:02 -0500 |
commit | 639467c8f26d834c934215e8b59129ce442475fe (patch) | |
tree | b9c4f115119b8106834e82d045b8dec7485214bd | |
parent | 37e1df8c95e2c8a57c77eafc097648f6e40a60ff (diff) |
ASoC: dapm: fix some pointer error handling
commit 66feeec9322132689d42723df2537d60f96f8e44
"RFC: ASoC: dapm: handle probe deferrals"
forgot a to update some two sites where the call
was used. The static codechecks quickly found them.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Fixes: 66feeec93221 ("RFC: ASoC: dapm: handle probe deferrals")
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | sound/soc/soc-dapm.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index b218cc7bd994..dcef67a9bd48 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c | |||
@@ -3935,6 +3935,16 @@ int snd_soc_dapm_new_dai_widgets(struct snd_soc_dapm_context *dapm, | |||
3935 | template.name); | 3935 | template.name); |
3936 | 3936 | ||
3937 | w = snd_soc_dapm_new_control_unlocked(dapm, &template); | 3937 | w = snd_soc_dapm_new_control_unlocked(dapm, &template); |
3938 | if (IS_ERR(w)) { | ||
3939 | int ret = PTR_ERR(w); | ||
3940 | |||
3941 | /* Do not nag about probe deferrals */ | ||
3942 | if (ret != -EPROBE_DEFER) | ||
3943 | dev_err(dapm->dev, | ||
3944 | "ASoC: Failed to create %s widget (%d)\n", | ||
3945 | dai->driver->playback.stream_name, ret); | ||
3946 | return ret; | ||
3947 | } | ||
3938 | if (!w) { | 3948 | if (!w) { |
3939 | dev_err(dapm->dev, "ASoC: Failed to create %s widget\n", | 3949 | dev_err(dapm->dev, "ASoC: Failed to create %s widget\n", |
3940 | dai->driver->playback.stream_name); | 3950 | dai->driver->playback.stream_name); |
@@ -3954,6 +3964,16 @@ int snd_soc_dapm_new_dai_widgets(struct snd_soc_dapm_context *dapm, | |||
3954 | template.name); | 3964 | template.name); |
3955 | 3965 | ||
3956 | w = snd_soc_dapm_new_control_unlocked(dapm, &template); | 3966 | w = snd_soc_dapm_new_control_unlocked(dapm, &template); |
3967 | if (IS_ERR(w)) { | ||
3968 | int ret = PTR_ERR(w); | ||
3969 | |||
3970 | /* Do not nag about probe deferrals */ | ||
3971 | if (ret != -EPROBE_DEFER) | ||
3972 | dev_err(dapm->dev, | ||
3973 | "ASoC: Failed to create %s widget (%d)\n", | ||
3974 | dai->driver->playback.stream_name, ret); | ||
3975 | return ret; | ||
3976 | } | ||
3957 | if (!w) { | 3977 | if (!w) { |
3958 | dev_err(dapm->dev, "ASoC: Failed to create %s widget\n", | 3978 | dev_err(dapm->dev, "ASoC: Failed to create %s widget\n", |
3959 | dai->driver->capture.stream_name); | 3979 | dai->driver->capture.stream_name); |