Diff between c84fcfff3c77c0bfe21b6777ba28fa085295cebc and e4cf43fc62b4e4dbabc72d4e44e095d7a9087992

Changed Files

File Additions Deletions Status
mesh/btmesh.c +7 -5 modified

Full Patch

diff --git a/mesh/btmesh.c b/mesh/btmesh.c
index 108ec39..6a005a9 100644
--- a/mesh/btmesh.c
+++ b/mesh/btmesh.c
@@ -137,8 +137,8 @@ int main(int argc, char *argv[])
 	bt_shell_set_menu(&main_menu);
 
 	if (!index_option) {
-		bt_shell_usage();
-		return 0;
+		l_info("Controller index is required");
+		goto fail;
 	}
 
 	if (config_option)
@@ -156,8 +156,7 @@ int main(int argc, char *argv[])
 	mesh = mesh_new(index, config_option);
 	if (!mesh) {
 		l_info("Failed to create mesh\n");
-		bt_shell_cleanup();
-		return EXIT_FAILURE;
+		goto fail;
 	}
 
 	if (save_option)
@@ -172,6 +171,9 @@ int main(int argc, char *argv[])
 	mesh_unref(mesh);
 	mesh_cleanup();
 	l_main_exit();
-
 	return status;
+
+fail:
+	bt_shell_cleanup();
+	return EXIT_FAILURE;
 }