summaryrefslogtreecommitdiff
path: root/65xx
diff options
context:
space:
mode:
authorkangsik.shin <kangsik.shin@lge.com>2013-06-13 11:29:49 -0700
committerVineeta Srivastava <vsrivastava@google.com>2013-06-13 11:31:00 -0700
commit8a501706d8a30295a312ccc05fba80097050204f (patch)
tree0a01fa9c2c4ad15d8e331bf693379ebc7b7ee6c4 /65xx
parentf240f0eaa236a598b331dc50771acd3e2a4baa9c (diff)
downloadinvensense-8a501706d8a30295a312ccc05fba80097050204f.tar.gz
Invensense: 65xx: Null check for pressor sensor (DO NOT MERGE)
system server is restarted repeatedly due to dataabort of the sensor HAL when sensor probe is failed. Change-Id: I9f0deb40ea54b377a870a3429791ad042a3d2265
Diffstat (limited to '65xx')
-rw-r--r--65xx/libsensors_iio/MPLSensor.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/65xx/libsensors_iio/MPLSensor.cpp b/65xx/libsensors_iio/MPLSensor.cpp
index b84bf3b..0871e46 100644
--- a/65xx/libsensors_iio/MPLSensor.cpp
+++ b/65xx/libsensors_iio/MPLSensor.cpp
@@ -1653,7 +1653,8 @@ int MPLSensor::enablePressure(int en)
int res = 0;
- res = mPressureSensor->enable(ID_PS, en);
+ if (mPressureSensor)
+ res = mPressureSensor->enable(ID_PS, en);
return res;
}
@@ -2960,7 +2961,8 @@ int MPLSensor::update_delay(void)
getDmpRate(&wanted);
}
- mPressureSensor->setDelay(ID_PS, wanted);
+ if (mPressureSensor)
+ mPressureSensor->setDelay(ID_PS, wanted);
LOGE_IF(res < 0, "HAL:PRESSURE update delay error");
}