summaryrefslogtreecommitdiffstats
path: root/collectors/freeipmi.plugin
diff options
context:
space:
mode:
authorStelios Fragkakis <52996999+stelfrag@users.noreply.github.com>2023-07-11 12:32:06 +0300
committerGitHub <noreply@github.com>2023-07-11 12:32:06 +0300
commit75ecb70175a778a8a389307b0048cf8fd53c5064 (patch)
tree7c6435e190d0873495618bb60cc4e8eeddea0db4 /collectors/freeipmi.plugin
parent4f3c121799f6be21da26fb2bf946907fd978ca63 (diff)
Fix coverity issues (#15345)
* sensor_name always has a value -- CID 395493: Control flow issues (DEADCODE) * Check fopen failure -- CID 395492: Null pointer dereferences (NULL_RETURNS) * CID 395491: Control flow issues (DEADCODE) * sel_count will be >=0 in this case -- CID 395490: Control flow issues (DEADCODE) * Memory leak -- CID 395487: Resource leaks (RESOURCE_LEAK)
Diffstat (limited to 'collectors/freeipmi.plugin')
-rw-r--r--collectors/freeipmi.plugin/freeipmi_plugin.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/collectors/freeipmi.plugin/freeipmi_plugin.c b/collectors/freeipmi.plugin/freeipmi_plugin.c
index edc7d28ebf..aeee56a219 100644
--- a/collectors/freeipmi.plugin/freeipmi_plugin.c
+++ b/collectors/freeipmi.plugin/freeipmi_plugin.c
@@ -518,7 +518,7 @@ static int netdata_get_ipmi_sel_events_count(struct ipmi_monitoring_ipmi_config
goto cleanup;
}
- netdata_update_ipmi_sel_events_count(state, sel_count >= 0 ? sel_count : 0);
+ netdata_update_ipmi_sel_events_count(state, sel_count);
rv = 0;
@@ -972,7 +972,7 @@ static void netdata_update_ipmi_sensor_reading(
.sensor_state = sensor_state,
.sensor_units = sensor_units,
.sensor_reading_type = sensor_reading_type,
- .sensor_name = strdupz(sensor_name ? sensor_name : ""),
+ .sensor_name = strdupz(sensor_name),
.component = netdata_sensor_name_to_component(sensor_name),
.do_state = !excluded_state,
.do_metric = !excluded_metric,
@@ -1245,7 +1245,7 @@ void *netdata_ipmi_collection_thread(void *ptr) {
t->state.sel.last_iteration_ut = 0;
}
- return ptr;
+ break;
}
spinlock_lock(&t->spinlock);