diff options
author | Sami Kerola | 2018-12-10 21:14:12 +0100 |
---|---|---|
committer | Sami Kerola | 2018-12-10 21:25:58 +0100 |
commit | e361253e886424cbe37693d92eb368a595fd9e9a (patch) | |
tree | f0efe72ccd89f63659f2fc46f6937c78d57a2ec5 /misc-utils/lsblk-devtree.c | |
parent | libmount: (umount) make mnt_stat_mountpoin() usable for relative paths (diff) | |
download | kernel-qcow2-util-linux-e361253e886424cbe37693d92eb368a595fd9e9a.tar.gz kernel-qcow2-util-linux-e361253e886424cbe37693d92eb368a595fd9e9a.tar.xz kernel-qcow2-util-linux-e361253e886424cbe37693d92eb368a595fd9e9a.zip |
lsblk: fix null pointer dereferences
Both catched with -Wnull-dereference compiler option:
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'misc-utils/lsblk-devtree.c')
-rw-r--r-- | misc-utils/lsblk-devtree.c | 3 |
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; } |