Skip to content

Commit

Permalink
ALSA: ppc: fix error return code in snd_pmac_probe()
Browse files Browse the repository at this point in the history
[ 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>
  • Loading branch information
Yang Yingliang authored and gregkh committed Jul 20, 2021
1 parent 21b28df commit df6b21c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sound/ppc/powermac.c
Expand Up @@ -76,7 +76,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:
Expand Down

0 comments on commit df6b21c

Please sign in to comment.