From: Karel Zak Date: Wed, 28 Jan 2015 13:33:30 +0000 (+0100) Subject: blockdev: check return when read from sysfs [coverity scan] X-Git-Tag: v2.26-rc2~61 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9eaa7292e4bcf10149964cf8d5d3150bc6aabd45;p=thirdparty%2Futil-linux.git blockdev: check return when read from sysfs [coverity scan] Signed-off-by: Karel Zak --- diff --git a/disk-utils/blockdev.c b/disk-utils/blockdev.c index 43aaef6d6b..ef6ee1d4d7 100644 --- a/disk-utils/blockdev.c +++ b/disk-utils/blockdev.c @@ -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 &&