media: solo6x10: fix missing snd_card_free in error handling case
authorQinglang Miao <miaoqinglang@huawei.com>
Wed, 11 Nov 2020 03:22:01 +0000 (04:22 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 29 Dec 2020 12:46:53 +0000 (13:46 +0100)
[ Upstream commit dcdff74fa6bc00c32079d0bebd620764c26f2d89 ]

Fix to goto snd_error in error handling case when fails
to do snd_ctl_add, as done elsewhere in this function.

Fixes: 28cae868cd24 ("[media] solo6x10: move out of staging into drivers/media/pci.")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/pci/solo6x10/solo6x10-g723.c

index 81be1b8df75849470a9ff4e030c7aeb5c4740f41..0cbb3ee96e1e842b9cab649b6053ac4d7137d0be 100644 (file)
@@ -401,7 +401,7 @@ int solo_g723_init(struct solo_dev *solo_dev)
 
        ret = snd_ctl_add(card, snd_ctl_new1(&kctl, solo_dev));
        if (ret < 0)
-               return ret;
+               goto snd_error;
 
        ret = solo_snd_pcm_init(solo_dev);
        if (ret < 0)