init_storage_config_info(MEMORY_STATUS_OPT_PATH, &storage_opt_info);
memnoti_timer = g_timeout_add(MEMNOTI_TIMER_INTERVAL,
check_storage_status, NULL);
- if (memnoti_timer == 0)
+
+ /**
+ * If allocation or initialization of the internal resource fails,
+ * g_timeout_add() returns 0 as id of the resource.
+ */
+ if (memnoti_timer == 0) {
_E("Failed mem available noti timer add.");
+ return -EWOULDBLOCK;
+ }
+
return 0;
}
_E("Failed to register dm_verity uevent: %d", ret_val);
}
- if (init_storage_config_info_all() == -1)
+ if (init_storage_config_info_all() < 0)
_E("Failed to remain mem noti control fd init.");
}