Blob Blame History Raw
From e56cf8d480c27bf3ea81af63efb4704896282c6a Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Mon, 17 Sep 2018 16:12:25 -0400
Subject: [PATCH 28/30] Fix dev->probes intialization test

Signed-off-by: Peter Jones <pjones@redhat.com>
---
 src/linux.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/linux.c b/src/linux.c
index ff8db812ad3..19eb488c992 100644
--- a/src/linux.c
+++ b/src/linux.c
@@ -117,7 +117,9 @@ reset_part_name(struct device *dev)
         if (dev->part < 1)
                 return 0;
 
-        if (dev->probes[dev->n_probes]->make_part_name) {
+        if (dev->n_probes > 0 &&
+            dev->probes[dev->n_probes-1] &&
+            dev->probes[dev->n_probes-1]->make_part_name) {
                 part = dev->probes[dev->n_probes]->make_part_name(dev);
                 dev->part_name = part;
                 rc = 0;
-- 
2.17.1