]> git.ipfire.org Git - thirdparty/collectd.git/commit
SMART plugin: initialize struct passed to `ioctl(2)`.
authorFlorian Forster <octo@collectd.org>
Sat, 25 Nov 2023 13:12:59 +0000 (14:12 +0100)
committerFlorian Forster <octo@collectd.org>
Wed, 29 Nov 2023 20:56:21 +0000 (21:56 +0100)
commita0eec8136de277fcede430e03ad4ad02fe39de8d
tree2f2051c913ab7c518d4bca290ea0484810038cb9
parentc4455ddca49df2466c3e1abb898e6c7c0544d0eb
SMART plugin: initialize struct passed to `ioctl(2)`.

Valgrind is complaining about a conditional jump based on uninitialized
memory:

```
==66462== Conditional jump or move depends on uninitialised value(s)
==66462==    at 0x10C500: smart_read_nvme_intel_disk (in /__w/collectd/collectd/test_plugin_smart)
==66462==    by 0x10D366: test_x (in /__w/collectd/collectd/test_plugin_smart)
==66462==    by 0x10D638: main (in /__w/collectd/collectd/test_plugin_smart)
```

This may be due to the `struct nvme_additional_smart_log` being
uninitialized when it's being passed to `ioctl(2)`.

This there, this removed an unnecessary level of indentation.
src/smart.c