Return error and exit the function in case registering the component
with the core is failing.

Signed-off-by: Christian Gromm <christian.gr...@microchip.com>
---
 drivers/staging/most/sound/sound.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/most/sound/sound.c 
b/drivers/staging/most/sound/sound.c
index e6396d1..80a8feb 100644
--- a/drivers/staging/most/sound/sound.c
+++ b/drivers/staging/most/sound/sound.c
@@ -742,8 +742,10 @@ 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) {
                pr_err("Failed to register %s configfs subsys\n", comp.name);
-- 
2.7.4

_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to