diff options
author | наб <[email protected]> | 2021-04-29 10:40:39 +0200 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2021-04-30 15:04:19 -0700 |
commit | 1a7d7182ac2cf5dd00cdf8667d996126908b7294 (patch) | |
tree | b96737b34669fbf78886c7cb54f3019925ca3a9d /lib/libzutil/os | |
parent | ccb46cab50f56238102cffc344cc2fbfc5fe908a (diff) |
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 <[email protected]>
Signed-off-by: Ahelenia Ziemiańska <[email protected]>
Closes #11935
Diffstat (limited to 'lib/libzutil/os')
-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 1775a45c6..da7ffba76 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 |