From bdbc066e4646876a774e940995859a4760b8946c Mon Sep 17 00:00:00 2001 From: Pavel Rochnyack Date: Wed, 25 May 2016 13:15:31 +0600 Subject: [PATCH] disk plugin: Call disk_udev_attr_name() only when UdevNameAttr configured --- src/disk.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/disk.c b/src/disk.c index 0d624886..07383c75 100644 --- a/src/disk.c +++ b/src/disk.c @@ -867,9 +867,13 @@ static int disk_read (void) output_name = disk_name; #if HAVE_LIBUDEV - char *alt_name = disk_udev_attr_name (handle_udev, disk_name, conf_udev_name_attr); - if (alt_name != NULL) - output_name = alt_name; + char *alt_name = NULL; + if (conf_udev_name_attr != NULL) + { + alt_name = disk_udev_attr_name (handle_udev, disk_name, conf_udev_name_attr); + if (alt_name != NULL) + output_name = alt_name; + } #endif if (ignorelist_match (ignorelist, output_name) != 0) -- 2.11.0