blockdev: check return when read from sysfs [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
Karel Zak 2015-01-28 14:33:30 +01:00
parent ec8a728ae0
commit 9eaa7292e4
1 changed files with 4 additions and 1 deletions

View 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 &&