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
This commit is contained in:
наб 2021-04-29 10:40:39 +02:00 committed by Brian Behlendorf
parent ccb46cab50
commit 1a7d7182ac
1 changed files with 1 additions and 1 deletions

View File

@ -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