From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Price Date: Fri, 6 Jan 2012 15:19:21 +0000 Subject: [Cluster-devel] [PATCH 02/11] gfs2_edit: Check return value of compute_constants In-Reply-To: <1325863170-32530-1-git-send-email-anprice@redhat.com> References: <1325863170-32530-1-git-send-email-anprice@redhat.com> Message-ID: <1325863170-32530-2-git-send-email-anprice@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Spotted by coverity: Calling function "compute_constants" without checking return value. Signed-off-by: Andrew Price --- gfs2/edit/hexedit.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/gfs2/edit/hexedit.c b/gfs2/edit/hexedit.c index 73fb39f..fcab625 100644 --- a/gfs2/edit/hexedit.c +++ b/gfs2/edit/hexedit.c @@ -1276,7 +1276,10 @@ static void read_superblock(int fd) perror(sbd.device_name); exit(-1); } - compute_constants(&sbd); + if(compute_constants(&sbd)) { + fprintf(stderr, "Failed to compute constants.\n"); + exit(-1); + } if (sbd.gfs1 || (sbd.sd_sb.sb_header.mh_magic == GFS2_MAGIC && sbd.sd_sb.sb_header.mh_type == GFS2_METATYPE_SB)) block = 0x10 * (GFS2_DEFAULT_BSIZE / sbd.bsize); -- 1.7.6.4