]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
chmem: check ul_path_readf_s32() return value [coverity: CID 504055]
authorKarel Zak <kzak@redhat.com>
Mon, 13 Jul 2026 10:35:39 +0000 (12:35 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 13 Jul 2026 10:35:39 +0000 (12:35 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/chmem.c

index 1034e854b9c4613f4b697415166e4cbbb2d20dde..6124d88cf6f3d0734c9da7941f47ac0fe8e13198 100644 (file)
@@ -226,7 +226,8 @@ static int chmem_configured(struct chmem_desc *desc, char *name)
 {
        int mblock_configured = 0;
 
-       ul_path_readf_s32(desc->sysmemconfig, &mblock_configured, "%s/config", name);
+       if (ul_path_readf_s32(desc->sysmemconfig, &mblock_configured, "%s/config", name) != 0)
+               return 0;
        return mblock_configured;
 }