kpartx: fix bad dm_devn return
authorBenjamin Marzinski <bmarzins@redhat.com>
Wed, 1 Aug 2018 20:57:00 +0000 (15:57 -0500)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Tue, 7 Aug 2018 13:30:27 +0000 (15:30 +0200)
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 <bmarzins@redhat.com>
kpartx/devmapper.c

index cd33449..8db1eb5 100644 (file)
@@ -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;