Fix crash in mdstat module (#4992)
Vladimir Kobal committed
Dec 15, 2018 at 03:34 UTC
493b0dd36c6e25aa4daae95df6c324c89239b0b8
1 file changed
+2
-2
collectors/proc.plugin/proc_mdstat.c
+2
-2
@@ -361,9 +361,9 @@ int do_proc_mdstat(int update_every, usec_t dt) {
361
362
// --------------------------------------------------------------------
363
364
- if(likely(do_health)) {
364
+ if(likely(do_health && redundant_num)) {
365
static RRDSET *st_mdstat_health = NULL;
366
- if(unlikely(!st_mdstat_health && redundant_num)) {
366
+ if(unlikely(!st_mdstat_health)) {
367
st_mdstat_health = rrdset_create_localhost(
368
"mdstat"
369
, "mdstat_health"