diff options
author | наб <nabijaczleweli@nabijaczleweli.xyz> | 2021-04-29 08:40:39 +0000 |
---|---|---|
committer | Brian Behlendorf <behlendorf1@llnl.gov> | 2021-04-30 22:04:19 +0000 |
commit | 1a7d7182ac2cf5dd00cdf8667d996126908b7294 (patch) | |
tree | b96737b34669fbf78886c7cb54f3019925ca3a9d | |
parent | ccb46cab50f56238102cffc344cc2fbfc5fe908a (diff) | |
download | src-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.c | 2 |
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 |