summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ivi-shell/ivi-layout.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c
index 6b2604e1..cd4a171f 100644
--- a/ivi-shell/ivi-layout.c
+++ b/ivi-shell/ivi-layout.c
@@ -2953,12 +2953,14 @@ load_controller_modules(struct weston_compositor *compositor, const char *module
snprintf(buffer, sizeof buffer, "%.*s", (int)(end - p), p);
controller_module_init = weston_load_module(buffer, "controller_module_init");
- if (controller_module_init)
- if(controller_module_init(compositor, argc, argv,
- &ivi_controller_interface,
- sizeof(struct ivi_controller_interface)) != 0) {
- weston_log("ivi-shell: Initialization of controller module fails");
- return -1;
+ if (!controller_module_init)
+ return -1;
+
+ if (controller_module_init(compositor, argc, argv,
+ &ivi_controller_interface,
+ sizeof(struct ivi_controller_interface)) != 0) {
+ weston_log("ivi-shell: Initialization of controller module fails");
+ return -1;
}
p = end;