]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lib/loopdev: avoid null pointer dereferences [coverity]
authorKarel Zak <kzak@redhat.com>
Thu, 23 Oct 2025 10:34:08 +0000 (12:34 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 23 Oct 2025 10:34:08 +0000 (12:34 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
lib/loopdev.c

index 389cb100ee2e33f6f595cb56e787663fac0ff680..efc997f874c97bd5eb87bd447b02bc88c82b5f92 100644 (file)
@@ -1617,7 +1617,7 @@ static int loopcxt_get_device_nr(struct loopdev_cxt *lc, int *nr)
 
        errno = 0;
        if (!lc || !nr)
-               goto done;
+               return rc;
 
        dev = loopcxt_get_device(lc);
        if (!dev)