aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorнаб <nabijaczleweli@nabijaczleweli.xyz>2021-04-29 08:40:39 +0000
committerBrian Behlendorf <behlendorf1@llnl.gov>2021-04-30 22:04:19 +0000
commit1a7d7182ac2cf5dd00cdf8667d996126908b7294 (patch)
treeb96737b34669fbf78886c7cb54f3019925ca3a9d
parentccb46cab50f56238102cffc344cc2fbfc5fe908a (diff)
downloadsrc-1a7d7182ac2cf5dd00cdf8667d996126908b7294.tar.gz
src-1a7d7182ac2cf5dd00cdf8667d996126908b7294.zip
libzutil: fix dm_get_underlying_path() return if not a DM device
For example, this would happily return "/dev/(null)" for /dev/sda1 Reviewed-by: Tony Hutter <hutter2@llnl.gov> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Closes #11935
-rw-r--r--lib/libzutil/os/linux/zutil_device_path_os.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libzutil/os/linux/zutil_device_path_os.c b/lib/libzutil/os/linux/zutil_device_path_os.c
index 1775a45c6092..da7ffba764a8 100644
--- a/lib/libzutil/os/linux/zutil_device_path_os.c
+++ b/lib/libzutil/os/linux/zutil_device_path_os.c
@@ -346,7 +346,7 @@ end:
free(tmp);
free(realp);
- if (!path) {
+ if (!path && first_path) {
/*
* None of the underlying paths had a link back to their
* enclosure devices. Throw up out hands and return the first