]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libblkid: ubi: fix probe return values
authorKarel Zak <kzak@redhat.com>
Wed, 15 Apr 2026 15:18:20 +0000 (17:18 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 23 Apr 2026 12:07:45 +0000 (14:07 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
libblkid/src/superblocks/ubi.c

index b15199bd4981632aa088c23dae99573d9cc5b7fb..499c5ceaa560fac3bff5d142d3fcc4920fa42509 100644 (file)
@@ -39,10 +39,10 @@ static int probe_ubi(blkid_probe pr, const struct blkid_idmag *mag)
 
        hdr = blkid_probe_get_sb(pr, mag, struct ubi_ec_hdr);
        if (!hdr)
-               return -1;
+               return errno ? -errno : BLKID_PROBE_NONE;
 
        if (!ubi_verify_csum(pr, hdr))
-               return -1;
+               return BLKID_PROBE_NONE;
 
        blkid_probe_sprintf_version(pr, "%u", hdr->version);
        blkid_probe_sprintf_uuid(pr, (unsigned char *)&hdr->image_seq, 4, "%u",