plugin: iot-headless: display: add handling code to return check
authorYunhee Seo <yuni.seo@samsung.com>
Thu, 26 Jan 2023 10:50:04 +0000 (19:50 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Fri, 27 Jan 2023 03:30:39 +0000 (12:30 +0900)
Add handling code to resolve issue reported by static analysis.

Change-Id: I761e84429ad3372a029a7daedd2ef430a1472c23
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
(cherry picked from commit 523bcf82fbc6d051b41f247ff4b5e00ac74ce42a)

plugins/iot-headless/display/core.c

index 9db1fdd823a29f5ecd6773dee776811acb87894e..ac7bd1116716d47878d71ff7891eece2e861698f 100644 (file)
@@ -20,6 +20,8 @@
 #include <shared/devices.h>
 #include <libsyscommon/libgdbus.h>
 
+#include "core/log.h"
+
 static GVariant *dbus_lockstate(GDBusConnection *conn,
        const gchar *sender, const gchar *path, const gchar *iface, const gchar *name,
        GVariant *param, GDBusMethodInvocation *invocation, gpointer user_data)
@@ -48,7 +50,11 @@ static const dbus_interface_u dbus_interface = {
 
 static void display_init(void *data)
 {
-       gdbus_add_object(NULL, DEVICED_PATH_DISPLAY, &dbus_interface);
+       int ret = 0;
+
+       ret = gdbus_add_object(NULL, DEVICED_PATH_DISPLAY, &dbus_interface);
+       if (ret < 0)
+               _W("Failed to init plugin iot-headless display dbus interface(%d)", ret);
 }
 
 static const struct device_ops display_device_ops = {