summaryrefslogtreecommitdiffstats
path: root/misc-utils/lsblk-devtree.c
diff options
context:
space:
mode:
Diffstat (limited to 'misc-utils/lsblk-devtree.c')
-rw-r--r--misc-utils/lsblk-devtree.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/misc-utils/lsblk-devtree.c b/misc-utils/lsblk-devtree.c
index 82db4f8cf..a2aa26aed 100644
--- a/misc-utils/lsblk-devtree.c
+++ b/misc-utils/lsblk-devtree.c
@@ -203,7 +203,8 @@ int lsblk_device_is_last_parent(struct lsblk_device *dev, struct lsblk_device *p
struct lsblk_devdep *dp = list_last_entry(
&dev->parents,
struct lsblk_devdep, ls_parents);
-
+ if (!dp)
+ return 0;
return dp->parent == parent;
}