e_devicemgr: add null checking and break from for-loop 38/284538/1
authorduna.oh <duna.oh@samsung.com>
Fri, 11 Nov 2022 02:35:59 +0000 (11:35 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Fri, 18 Nov 2022 09:53:50 +0000 (18:53 +0900)
Change-Id: I83d7b62195b21997cec9e0c242644506dc37e587

src/bin/e_comp_wl_input.c
src/bin/e_devicemgr_wl.c

index 46539830d3688d126661bea32b126aaaab923d91..522bae6e43c5191319f43f8214ed780d43684eac 100644 (file)
@@ -384,6 +384,7 @@ _e_comp_wl_input_cb_bind_seat(struct wl_client *client, void *data EINA_UNUSED,
         DBG("wl_seat (res: %d) is already bound to client (%p)",
             wl_resource_get_id(tmp_res), client);
         seat->is_first_resource = 0;
+        break;
      }
 
    res = wl_resource_create(client, &wl_seat_interface, version, id);
index f459cc91c41edf9d1bb26105c7276601960a8a99..dbfe75d82288809929610901e789452b2378c091 100644 (file)
@@ -146,6 +146,7 @@ e_devicemgr_wl_device_add(E_Devicemgr_Input_Device *dev)
    EINA_LIST_FOREACH(e_comp_wl->seat.resources, l, seat_res)
      {
         seat_data = wl_resource_get_user_data(seat_res);
+        if (!seat_data) continue;
         if (!seat_data->is_first_resource)
           {
              DMDBG("The seat (res:%d) is not the first resource bound to client (%p)",
@@ -167,11 +168,11 @@ e_devicemgr_wl_device_add(E_Devicemgr_Input_Device *dev)
                }
              res = wl_resource_create(wc, &tizen_input_device_interface, 1, 0);
              if (!res)
-                 {
+               {
                   DMERR("Could not create tizen_input_device resource");
                   wl_client_post_no_memory(wc);
                   break;
-                }
+               }
 
              device_user_data = E_NEW(E_Devicemgr_Input_Device_User_Data, 1);
              if (!device_user_data)
@@ -600,6 +601,7 @@ _e_devicemgr_wl_cb_bind(struct wl_client *client, void *data, uint32_t version,
         DMDBG("tizen_input_device_manager (res: %d) is already bound to client (%p)",
               wl_resource_get_id(tmp_data->resource), client);
         mgr_data->is_first_resource = 0;
+        break;
      }
 
    if (!(res = wl_resource_create(client, &tizen_input_device_manager_interface, version, id)))