]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
blockdev: check return when read from sysfs [coverity scan]
authorKarel Zak <kzak@redhat.com>
Wed, 28 Jan 2015 13:33:30 +0000 (14:33 +0100)
committerKarel Zak <kzak@redhat.com>
Wed, 28 Jan 2015 13:33:36 +0000 (14:33 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
disk-utils/blockdev.c

index 43aaef6d6b2d8a0a811f5637a2a454eda5330542..ef6ee1d4d71be94d4725796597675b80432551f8 100644 (file)
@@ -455,7 +455,10 @@ static void report_device(char *device, int quiet)
                        err(EXIT_FAILURE,
                                _("%s: failed to initialize sysfs handler"),
                                device);
-               sysfs_read_u64(&cxt, "start", &start);
+               if (sysfs_read_u64(&cxt, "start", &start))
+                       err(EXIT_FAILURE,
+                               _("%s: failed to read partition start from sysfs"),
+                               device);
                sysfs_deinit(&cxt);
        }
        if (ioctl(fd, BLKROGET, &ro) == 0 &&