diff options
author | YueHaibing <yuehaibing@huawei.com> | 2019-08-27 21:13:46 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-08-28 22:22:13 +0200 |
commit | 3982f1df00df57768f0782bc702fc4fbea347ca2 (patch) | |
tree | 2c7579ad26a3cc83d1ceb16a2dbca830f080a312 /drivers/staging/most | |
parent | a1617c8c3d39b1348e72d04548229e2ed9bf8121 (diff) | |
download | linux-3982f1df00df57768f0782bc702fc4fbea347ca2.tar.gz linux-3982f1df00df57768f0782bc702fc4fbea347ca2.tar.bz2 linux-3982f1df00df57768f0782bc702fc4fbea347ca2.zip |
staging: most: sound: Fix error path of audio_init
If most_register_configfs_subsys() fails, we should
call most_deregister_component() do cleanup.
Reported-by: Hulk Robot <hulkci@huawei.com>
Fixes: 919c03ae11b9 ("staging: most: enable configfs support")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/r/20190827131346.12704-1-yuehaibing@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/most')
-rw-r--r-- | drivers/staging/most/sound/sound.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/staging/most/sound/sound.c b/drivers/staging/most/sound/sound.c index 342f390d68b3..79817061fcfa 100644 --- a/drivers/staging/most/sound/sound.c +++ b/drivers/staging/most/sound/sound.c @@ -802,8 +802,11 @@ static int __init audio_init(void) if (ret) pr_err("Failed to register %s\n", comp.name); ret = most_register_configfs_subsys(&comp); - if (ret) + if (ret) { pr_err("Failed to register %s configfs subsys\n", comp.name); + most_deregister_component(&comp); + } + return ret; } |