2020-11-11 03:19:17

by Qinglang Miao

[permalink] [raw]
Subject: [PATCH] media: solo6x10: fix missing snd_card_free in error handling case

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 <[email protected]>
Signed-off-by: Qinglang Miao <[email protected]>
---
drivers/media/pci/solo6x10/solo6x10-g723.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/pci/solo6x10/solo6x10-g723.c b/drivers/media/pci/solo6x10/solo6x10-g723.c
index 906ce86437ae..d137b94869d8 100644
--- a/drivers/media/pci/solo6x10/solo6x10-g723.c
+++ b/drivers/media/pci/solo6x10/solo6x10-g723.c
@@ -385,7 +385,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)
--
2.23.0


2020-11-11 18:31:29

by Ismael Luceno

[permalink] [raw]
Subject: Re: [PATCH] media: solo6x10: fix missing snd_card_free in error handling case

On 11/Nov/2020 11:22, Qinglang Miao wrote:
> 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 <[email protected]>
> Signed-off-by: Qinglang Miao <[email protected]>
> ---
> drivers/media/pci/solo6x10/solo6x10-g723.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/media/pci/solo6x10/solo6x10-g723.c b/drivers/media/pci/solo6x10/solo6x10-g723.c
> index 906ce86437ae..d137b94869d8 100644
> --- a/drivers/media/pci/solo6x10/solo6x10-g723.c
> +++ b/drivers/media/pci/solo6x10/solo6x10-g723.c
> @@ -385,7 +385,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)
> --
> 2.23.0
>

Signed-off-by: Ismael Luceno <[email protected]>