Prevent duplicate initialization of sensor 09/245609/1
authorHwankyu Jhun <h.jhun@samsung.com>
Tue, 13 Oct 2020 06:45:12 +0000 (15:45 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Tue, 13 Oct 2020 06:45:12 +0000 (15:45 +0900)
To prevent duplicate initialization, this patch adds an exception
handling to check whether the initialized flag is true or NOT.

Change-Id: If8d38e6ffd3570e9ffa25a4f0745de479d549d8a
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/modules/splash-screen/src/splash-screen.c

index a0f9df8d938b8d9bd8c19f8597bc4276fd821af2..29768a2b812e13566b02539dcc96a36bfdd7ad40 100644 (file)
@@ -627,6 +627,9 @@ static int __init_rotation(void)
                return 0;
        }
 
+       if (rotation.initialized)
+               return 0;
+
        if (!rotation.sensor) {
                rotation.sensor = sensord_get_sensor(AUTO_ROTATION_SENSOR);
                if (!rotation.sensor) {