]> git.ipfire.org Git - thirdparty/collectd.git/commit
SMART plugin: initialize struct passed to `ioctl(2)`. 4165/head
authorFlorian Forster <octo@collectd.org>
Sat, 25 Nov 2023 13:12:59 +0000 (14:12 +0100)
committerFlorian Forster <octo@collectd.org>
Sat, 25 Nov 2023 13:12:59 +0000 (14:12 +0100)
commit16db68e4250c3e244587632062b92027fc12a489
tree907467c14e8d75f50b44074e4cd776820a66c63d
parent203a382da8dc0f5bb58a3a03f4ad9f91f25c470f
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