Android-x86
Fork
Faire un don

  • R/O
  • HTTP
  • SSH
  • HTTPS

hardware-libsensors: Commit

hardware/libsensors


Commit MetaInfo

Révision168c15b9a7e045eeaa24a9dcfd61ee9ec364410d (tree)
l'heure2019-07-02 12:55:43
AuteurChih-Wei Huang <cwhuang@linu...>
CommiterChih-Wei Huang

Message de Log

kbdsensor: fix uninitialized error

Initialize the struct sensors_poll_device_1 to zero, otherwise some
members may have unexpected value which causes crashing.

Change Summary

Modification

--- a/kbdsensor.cpp
+++ b/kbdsensor.cpp
@@ -48,6 +48,7 @@ template <typename T> struct SensorFd : T {
4848
4949 template <typename T> SensorFd<T>::SensorFd(const struct hw_module_t *module)
5050 {
51+ memset(this, 0, sizeof(*this));
5152 this->common.tag = HARDWARE_DEVICE_TAG;
5253 this->common.version = SENSORS_DEVICE_API_VERSION_1_3;
5354 this->common.module = const_cast<struct hw_module_t *>(module);
Afficher sur ancien navigateur de dépôt.