1. 15 Jul, 2022 1 commit
  2. 13 Jul, 2022 2 commits
  3. 24 Jun, 2022 1 commit
  4. 04 Apr, 2022 1 commit
  5. 29 Mar, 2022 2 commits
    • Bastien Nocera's avatar
      iio: Fix sysfs attribute verification failing · ad2c296b
      Bastien Nocera authored
      sysfs usually appends newlines at the end of attributes to make them
      easier to consume, but the test suite can't test for that.
      
      ** (iio-sensor-proxy:4882): WARNING **: 14:14:46.792: Possible failure in string write of 'accel_3d-dev0
      ' Should be 'accel_3d-dev0' written to /sys/devices/platform/AMDI0010:02/i2c-2/i2c-BMA250E:00/0018:6243:0001.0002/HID-SENSOR-200073.2.auto/iio:device0/trigger/current_trigger
      
      Closes: #347
      
      Fixes: ac053f8a
      ad2c296b
    • Bastien Nocera's avatar
      iio: Remove left-over debug · 3d67c6dc
      Bastien Nocera authored
      3d67c6dc
  6. 25 Mar, 2022 14 commits
    • Bastien Nocera's avatar
      7124a42d
    • Bastien Nocera's avatar
      main: Fix warning in accel_changed_func() · 5ba03b06
      Bastien Nocera authored
      From Coverity:
      iio-sensor-proxy-3.3/src/iio-sensor-proxy.c:727:16: warning[deadcode.DeadStores]: Value stored to 'orientation' during its initialization is never read
      5ba03b06
    • Bastien Nocera's avatar
      iio: Remove fscanf usage in _write_sysfs_string() · ac053f8a
      Bastien Nocera authored
      From Coverity:
      iio-sensor-proxy-3.3/src/iio-buffer-utils.c:435: dont_call: "fscanf" assumes an arbitrarily long string, so callers must use correct precision specifiers or never use "fscanf".
      
      This also fixes the temp variable being reused to parse the contents of
      the sysfs file before being freed. How this behaves depends on the
      length of the sysfs file path and the length of the string inside the
      file.
      ac053f8a
    • Bastien Nocera's avatar
      iio: Simplify _write_sysfs_string() · 7ba893a6
      Bastien Nocera authored
      Use g_autofree to avoid a goto on error.
      7ba893a6
    • Bastien Nocera's avatar
      iio: Fix filename variable leak in build_channel_array() · 62bb3596
      Bastien Nocera authored
      From Coverity:
      iio-sensor-proxy-3.3/src/iio-buffer-utils.c:289: leaked_storage: Variable "filename" going out of scope leaks the storage it points to.
      62bb3596
    • Bastien Nocera's avatar
      iio: Fix channel info leak in build_channel_array() · d87732b6
      Bastien Nocera authored
      On error, the channel info would just be left unfreed.
      
      From Coverity:
      iio-sensor-proxy-3.3/src/iio-buffer-utils.c:330: leaked_storage: Variable "current" going out of scope leaks the storage it points to.
      iio-sensor-proxy-3.3/src/iio-buffer-utils.c:312: leaked_storage: Variable "current" going out of scope leaks the storage it points to.
      iio-sensor-proxy-3.3/src/iio-buffer-utils.c:304: leaked_storage: Variable "current" going out of scope leaks the storage it points to.
      iio-sensor-proxy-3.3/src/iio-buffer-utils.c:302: leaked_storage: Variable "current" going out of scope leaks the storage it points to.
      iio-sensor-proxy-3.3/src/iio-buffer-utils.c:293: leaked_storage: Variable "current" going out of scope leaks the storage it points to.
      iio-sensor-proxy-3.3/src/iio-buffer-utils.c:289: leaked_storage: Variable "current" going out of scope leaks the storage it points to.
      iio-sensor-proxy-3.3/src/iio-buffer-utils.c:350:2: warning[unix.Malloc]: Potential leak of memory pointed to by 'current'
      d87732b6
    • Bastien Nocera's avatar
      iio: Fix leak in buffer_drv_data_free() · 18a043f3
      Bastien Nocera authored
      From Coverity:
      iio-sensor-proxy-3.3/src/iio-buffer-utils.c:769: noescape: Resource "buffer_data" is not freed or pointed-to in "buffer_drv_data_free".
      iio-sensor-proxy-3.3/src/iio-buffer-utils.c:770:3: warning[unix.Malloc]: Potential leak of memory pointed to by 'buffer_data'
      18a043f3
    • Bastien Nocera's avatar
      mount-matrix: Fix unchecked return value · a4b1f3ee
      Bastien Nocera authored
      From Coverity:
      iio-sensor-proxy-3.3/src/accel-mount-matrix.c:86: check_return: Calling "parse_mount_matrix" without checking return value (as is done elsewhere 10 out of 11 times).
      a4b1f3ee
    • Bastien Nocera's avatar
    • Bastien Nocera's avatar
      main: Check g_setenv() return value · 2e3d7bb7
      Bastien Nocera authored
      From Coverity:
      iio-sensor-proxy-3.3/src/iio-sensor-proxy.c:964: check_return: Calling "g_setenv("G_MESSAGES_DEBUG", "all", 1)" without checking return value. This library function may fail and return an error code.
      2e3d7bb7
    • Bastien Nocera's avatar
      iio: Fix filename leak in iioutils_get_param_float() · a279a805
      Bastien Nocera authored
      From Coverity:
      iio-sensor-proxy-3.3/src/iio-buffer-utils.c:173: leaked_storage: Variable "filename" going out of scope leaks the storage it points to.
      a279a805
    • Bastien Nocera's avatar
      iio: Fix filename variable leak in iioutils_get_type() · 1f4e5cff
      Bastien Nocera authored
      From Coverity:
      iio-sensor-proxy-3.3/src/iio-buffer-utils.c:111: overwrite_var: Overwriting "filename" in "filename = g_build_filename(device_dir, "scan_elements", builtname, NULL)" leaks the storage that "filename" points to.
      1f4e5cff
    • Bastien Nocera's avatar
      iio: Simplify iioutils_break_up_name() · 0ca80165
      Bastien Nocera authored
      Use g_auto() to simplify the memory management.
      0ca80165
    • Bastien Nocera's avatar
      build: Fix run_command() usage in newer meson · 418f00ac
      Bastien Nocera authored
      WARNING: You should add the boolean check kwarg to the run_command call.
               It currently defaults to false,
               but it will default to true in future releases of meson.
               See also: https://github.com/mesonbuild/meson/issues/9300
      418f00ac
  7. 15 Mar, 2022 1 commit
    • Bastien Nocera's avatar
      main: Prefer buffer driver to polling driver · 716ee37d
      Bastien Nocera authored
      In c7fb43e0, we added a buffer driver for ambient light sensors, but we
      added it to the list of drivers in a way that would favour polling
      drivers. Since we started using IIO_SENSOR_PROXY_TYPE to tag devices,
      and as those can support multiple drivers, we need to prefer the buffer
      driver as it's the one that doesn't require constant monitoring.
      
      This also fixes operations on some Dell laptops where the polling driver
      is completely broken.
      
      See !352
      716ee37d
  8. 14 Mar, 2022 2 commits
  9. 21 Dec, 2021 1 commit
  10. 29 Sep, 2021 3 commits
  11. 07 Sep, 2021 2 commits
  12. 19 Aug, 2021 2 commits
  13. 16 Aug, 2021 3 commits
  14. 14 Aug, 2021 5 commits