summaryrefslogtreecommitdiff
path: root/sound/ppc
diff options
context:
space:
mode:
authorYang Yingliang <yangyingliang@huawei.com>2021-06-16 10:11:21 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-07-20 16:10:44 +0200
commit75dc1942f8b62228179a41c1f5af08256fdef2dc (patch)
tree76b58dd60e65fe886ac03047cda4cc8fc45897d9 /sound/ppc
parent8e1b6d96e95fb979e0a046f299d41ee3c9ed7f8c (diff)
ALSA: ppc: fix error return code in snd_pmac_probe()
[ Upstream commit 80b9c1be567c3c6bbe0d4b290af578e630485b5d ] If snd_pmac_tumbler_init() or snd_pmac_tumbler_post_init() fails, snd_pmac_probe() need return error code. Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Link: https://lore.kernel.org/r/20210616021121.1991502-1-yangyingliang@huawei.com Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'sound/ppc')
-rw-r--r--sound/ppc/powermac.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sound/ppc/powermac.c b/sound/ppc/powermac.c
index 96ef55082bf9..b135d114ce89 100644
--- a/sound/ppc/powermac.c
+++ b/sound/ppc/powermac.c
@@ -77,7 +77,11 @@ static int snd_pmac_probe(struct platform_device *devptr)
sprintf(card->shortname, "PowerMac %s", name_ext);
sprintf(card->longname, "%s (Dev %d) Sub-frame %d",
card->shortname, chip->device_id, chip->subframe);
- if ( snd_pmac_tumbler_init(chip) < 0 || snd_pmac_tumbler_post_init() < 0)
+ err = snd_pmac_tumbler_init(chip);
+ if (err < 0)
+ goto __error;
+ err = snd_pmac_tumbler_post_init();
+ if (err < 0)
goto __error;
break;
case PMAC_AWACS: