Skip to content

Commit c7f2112

Browse files
Yang Yinglianggregkh
authored andcommitted
ALSA: ppc: fix error return code in snd_pmac_probe()
[ Upstream commit 80b9c1b ] 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>
1 parent 1004c52 commit c7f2112

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎sound/ppc/powermac.c‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,11 @@ static int snd_pmac_probe(struct platform_device *devptr)
7777
sprintf(card->shortname, "PowerMac %s", name_ext);
7878
sprintf(card->longname, "%s (Dev %d) Sub-frame %d",
7979
card->shortname, chip->device_id, chip->subframe);
80-
if ( snd_pmac_tumbler_init(chip) < 0 || snd_pmac_tumbler_post_init() < 0)
80+
err = snd_pmac_tumbler_init(chip);
81+
if (err < 0)
82+
goto __error;
83+
err = snd_pmac_tumbler_post_init();
84+
if (err < 0)
8185
goto __error;
8286
break;
8387
case PMAC_AWACS:

0 commit comments

Comments
 (0)