staging: most: sound: fix error path
authorChristian Gromm <christian.gromm@microchip.com>
Tue, 23 Jun 2020 15:07:32 +0000 (17:07 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Jun 2020 13:41:17 +0000 (15:41 +0200)
Return error and exit the function in case registering the component
with the core is failing.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Link: https://lore.kernel.org/r/1592924855-25569-3-git-send-email-christian.gromm@microchip.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/most/sound/sound.c

index e6396d11cbb0f5a9238675a22329d46b0728f9f0..80a8feba16623a15bbd516eea769b7ba1dc0ac7b 100644 (file)
@@ -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);