Blame SOURCES/0028-Fix-dev-probes-intialization-test.patch

821f82
From e56cf8d480c27bf3ea81af63efb4704896282c6a Mon Sep 17 00:00:00 2001
821f82
From: Peter Jones <pjones@redhat.com>
821f82
Date: Mon, 17 Sep 2018 16:12:25 -0400
821f82
Subject: [PATCH 28/30] Fix dev->probes intialization test
821f82
821f82
Signed-off-by: Peter Jones <pjones@redhat.com>
821f82
---
821f82
 src/linux.c | 4 +++-
821f82
 1 file changed, 3 insertions(+), 1 deletion(-)
821f82
821f82
diff --git a/src/linux.c b/src/linux.c
821f82
index ff8db812ad3..19eb488c992 100644
821f82
--- a/src/linux.c
821f82
+++ b/src/linux.c
821f82
@@ -117,7 +117,9 @@ reset_part_name(struct device *dev)
821f82
         if (dev->part < 1)
821f82
                 return 0;
821f82
 
821f82
-        if (dev->probes[dev->n_probes]->make_part_name) {
821f82
+        if (dev->n_probes > 0 &&
821f82
+            dev->probes[dev->n_probes-1] &&
821f82
+            dev->probes[dev->n_probes-1]->make_part_name) {
821f82
                 part = dev->probes[dev->n_probes]->make_part_name(dev);
821f82
                 dev->part_name = part;
821f82
                 rc = 0;
821f82
-- 
821f82
2.17.1
821f82