[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [Cluster-devel] [PATCH] Fix clang --analyze warning.



Hi Sits

On 17/12/12 14:43, Sitsofe Wheeler wrote:
- Return before a possible NULL pointer dereference.

This is now in gfs2-utils.git master.

Thanks,

Andy

---
  gfs2/libgfs2/fs_bits.c |    2 ++
  1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/gfs2/libgfs2/fs_bits.c b/gfs2/libgfs2/fs_bits.c
index 94a612b..e4b5505 100644
--- a/gfs2/libgfs2/fs_bits.c
+++ b/gfs2/libgfs2/fs_bits.c
@@ -149,6 +149,8 @@ int gfs2_set_bitmap(struct gfs2_sbd *sdp, uint64_t blkno, int state)
  			break;
  	}

+	if (bits == NULL)
+		return -1;
  	byte = (unsigned char *)(rgd->bh[buf]->b_data + bits->bi_offset) +
  		(rgrp_block/GFS2_NBBY - bits->bi_start);
  	bit = (rgrp_block % GFS2_NBBY) * GFS2_BIT_SIZE;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]