sensor: bug fix - function call w/o initializaion
authorJinhyung Choi <jinhyung2.choi@samsung.com>
Tue, 21 Jul 2015 05:42:23 +0000 (14:42 +0900)
committerJinhyung Choi <jinhyung2.choi@samsung.com>
Tue, 21 Jul 2015 05:47:52 +0000 (14:47 +0900)
mutex is used at set_sensor_data() and it is initialized when device is
realized.
Sensor may be used in some profile, such as tv.
However, skin will set rotation without considering profile.
Therefore, sensor will set value after checking validity.

Change-Id: If7482bdea338883ae82fbffa82ce86b06a029b3f
Signed-off-by: Jinhyung Choi <jinhyung2.choi@samsung.com>
tizen/src/hw/virtio/maru_virtio_sensor.c

index d0b6ce700ac60ce1a46023bbef87c299976cdb30..b36212821005a3d1eb645902d2471d55fb213886 100644 (file)
@@ -544,7 +544,9 @@ void req_sensor_data (enum sensor_types type, enum request_cmd req, char* data,
     char msg_info [__MAX_BUF_SENSOR];
     memset(msg_info, 0, sizeof(msg_info));
 
-    if (type >= sensor_type_max || (req != request_get && req != request_set)) {
+    if (type >= sensor_type_max
+            || (req != request_get && req != request_set)
+            || sensor_capability == 0) {
         LOG_SEVERE("unavailable sensor type request.\n");
         return;
     }