Fix a segmentation fault error in the updateProperty method

Program received signal SIGSEGV, Segmentation fault.
Sensor::updateProperty (this=0x4f4ae0, interface=..., oldValue=@0x4f4b80: nan(0x8000000000000),
    newValue=@0x7efff778: nan(0x8000000000000), dbusPropertyName=0x47d567 "Value")
    at /usr/src/debug/dbus-sensors/0.1+gitAUTOINC+623723b9e8-r0/git/include/sensor.hpp:307

It was caused by a missing null pointer checking on a dBus interface
so this commit adds the null pointer checking. This case can be
happened on Tjmax and Tthrottle in CPU sensors that intentionally
removed sensorInterface to make itself as a hidden sensor.

Change-Id: Idb5ed40777bf8a15258f864379d3decbcea779c3
Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com>
1 file changed
tree: 86ba67cbcfe09d09a4a4d7031456ae2993e5a444
  1. cmake/
  2. include/
  3. service_files/
  4. src/
  5. tests/
  6. .clang-format
  7. .clang-ignore
  8. .gitignore
  9. cmake-format.json
  10. CMakeLists.txt
  11. Jenkinsfile
  12. LICENSE
  13. MAINTAINERS
  14. README.md
README.md

dbus-sensors

dbus-sensors is a collection of sensor applications that provide the xyz.openbmc_project.Sensor collection of interfaces. They read sensor values from hwmon, d-bus, or direct driver access to provide readings. Some advance non-sensor features such as fan presence, pwm control, and automatic cpu detection (x86) are also supported.

key features

  • runtime re-configurable from d-bus (entity-manager or the like)

  • isolated: each sensor type is isolated into its own daemon, so a bug in one sensor is unlikely to affect another, and single sensor modifications are possible

  • async single-threaded: uses sdbusplus/asio bindings

  • multiple data inputs: hwmon, d-bus, direct driver access