Skip to content

Commit

Permalink
libzutil: fix dm_get_underlying_path() return if not a DM device
Browse files Browse the repository at this point in the history
For example, this would happily return "/dev/(null)" for /dev/sda1

Signed-off-by: Ahelenia Ziemiańska <[email protected]>
  • Loading branch information
nabijaczleweli committed Apr 29, 2021
1 parent 056a658 commit 8d396e3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/libzutil/os/linux/zutil_device_path_os.c
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ dm_get_underlying_path(const char *dm_name)
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
Expand Down

0 comments on commit 8d396e3

Please sign in to comment.