dm_devn shouldn't be returning success if you can't create a dm task to
find the device info. Found by coverity.

Signed-off-by: Benjamin Marzinski <[email protected]>
---
 kpartx/devmapper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kpartx/devmapper.c b/kpartx/devmapper.c
index cd33449..8db1eb5 100644
--- a/kpartx/devmapper.c
+++ b/kpartx/devmapper.c
@@ -365,7 +365,7 @@ dm_devn (const char * mapname, int *major, int *minor)
        struct dm_info info;
 
        if (!(dmt = dm_task_create(DM_DEVICE_INFO)))
-               return 0;
+               return 1;
 
        if (!dm_task_set_name(dmt, mapname))
                goto out;
-- 
2.7.4

--
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel

Reply via email to