[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20190621151637.34544-1-yuehaibing@huawei.com>
Date: Fri, 21 Jun 2019 23:16:37 +0800
From: YueHaibing <yuehaibing@...wei.com>
To: <gregkh@...uxfoundation.org>, <christian.gromm@...rochip.com>,
<colin.king@...onical.com>, <dan.carpenter@...cle.com>
CC: <linux-kernel@...r.kernel.org>, <devel@...verdev.osuosl.org>,
YueHaibing <yuehaibing@...wei.com>
Subject: [PATCH] staging: most: Fix error path of audio_init
If most_register_configfs_subsys fails, call
most_deregister_component to clean up.
Fixes: 919c03ae11b9 ("staging: most: enable configfs support")
Signed-off-by: YueHaibing <yuehaibing@...wei.com>
---
drivers/staging/most/sound/sound.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/most/sound/sound.c b/drivers/staging/most/sound/sound.c
index 342f390..05996a5 100644
--- a/drivers/staging/most/sound/sound.c
+++ b/drivers/staging/most/sound/sound.c
@@ -799,11 +799,17 @@ static int __init audio_init(void)
INIT_LIST_HEAD(&adpt_list);
ret = most_register_component(&comp);
- if (ret)
+ if (ret) {
pr_err("Failed to register %s\n", comp.name);
+ return ret;
+ }
+
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;
}
--
2.7.4
Powered by blists - more mailing lists