Fix coverity issue 33/255833/1 tizen
authorYoungjae Cho <y0.cho@samsung.com>
Wed, 24 Mar 2021 06:35:39 +0000 (15:35 +0900)
committerYoungjae Cho <y0.cho@samsung.com>
Wed, 24 Mar 2021 06:35:39 +0000 (15:35 +0900)
Change-Id: Ifaca1fa283a5afaada79945e012fae8a11ce3d1f
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
hw/touchscreen/touchscreen.c

index e80ab2ee379715cc35b9f49e3bd98a7e01bfb373..939a4faa454a1d346edb24e53ed5c11e1e5c6089 100644 (file)
@@ -140,13 +140,14 @@ static int touchscreen_init(void **data)
 {
        hal_backend_touchscreen_funcs *touchscreen_funcs;
 
-       touchscreen_funcs = calloc(1, sizeof(hal_backend_touchscreen_funcs));
-       if (!touchscreen_funcs)
-               return -ENOMEM;
 
        if (touchscreen_probe() < 0)
                return -ENOTSUP;
 
+       touchscreen_funcs = calloc(1, sizeof(hal_backend_touchscreen_funcs));
+       if (!touchscreen_funcs)
+               return -ENOMEM;
+
        touchscreen_funcs->get_state = touchscreen_get_state;
        touchscreen_funcs->set_state = touchscreen_set_state;