Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Cluster Development (http://www.linux-archive.org/cluster-development/)
-   -   gfs2_convert: Fix null pointer deref in journ_space_to_rg (http://www.linux-archive.org/cluster-development/619885-gfs2_convert-fix-null-pointer-deref-journ_space_to_rg.html)

Andrew Price 01-11-2012 05:21 PM

gfs2_convert: Fix null pointer deref in journ_space_to_rg
 
Spotted by coverity: Dereferencing null variable "rgdhigh".

Signed-off-by: Andrew Price <anprice@redhat.com>
---
gfs2/convert/gfs2_convert.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/gfs2/convert/gfs2_convert.c b/gfs2/convert/gfs2_convert.c
index 307b0f3..9b54670 100644
--- a/gfs2/convert/gfs2_convert.c
+++ b/gfs2/convert/gfs2_convert.c
@@ -1777,13 +1777,13 @@ static int journ_space_to_rg(struct gfs2_sbd *sdp)
(rgd->ri.ri_addr > rgdhigh->ri.ri_addr)))
rgdhigh = rgd;
} /* for each rg */
- log_info(_("Addr 0x%llx comes after rg at addr 0x%llx
"),
- (unsigned long long)jndx->ji_addr,
- (unsigned long long)rgdhigh->ri.ri_addr);
if (!rgdhigh) { /* if we somehow didn't find one. */
log_crit(_("Error: No suitable rg found for journal.
"));
return -1;
}
+ log_info(_("Addr 0x%llx comes after rg at addr 0x%llx
"),
+ (unsigned long long)jndx->ji_addr,
+ (unsigned long long)rgdhigh->ri.ri_addr);
ri_addr = jndx->ji_addr;
/* Allocate a new rgd entry which includes rg and ri. */
rgd = rgrp_insert(&sdp->rgtree, ri_addr);
--
1.7.6.5


All times are GMT. The time now is 09:48 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.