Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Oct 2012 20:41:38 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r241418 - head/sys/geom/raid
Message-ID:  <201210102041.q9AKfc6R096458@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Wed Oct 10 20:41:37 2012
New Revision: 241418
URL: http://svn.freebsd.org/changeset/base/241418

Log:
  NULL-ify last previously used pointer instead of last possible pointer.
  This should be only a cosmetic change.
  
  Found by:	Clang Static Analyzer

Modified:
  head/sys/geom/raid/md_promise.c

Modified: head/sys/geom/raid/md_promise.c
==============================================================================
--- head/sys/geom/raid/md_promise.c	Wed Oct 10 20:37:57 2012	(r241417)
+++ head/sys/geom/raid/md_promise.c	Wed Oct 10 20:41:37 2012	(r241418)
@@ -544,7 +544,7 @@ g_raid_md_promise_purge_disks(struct g_r
 			free(pd->pd_meta[i], M_MD_PROMISE);
 			for (j = i; j < pd->pd_subdisks - 1; j++)
 				pd->pd_meta[j] = pd->pd_meta[j + 1];
-			pd->pd_meta[PROMISE_MAX_SUBDISKS - 1] = NULL;
+			pd->pd_meta[pd->pd_subdisks - 1] = NULL;
 			pd->pd_subdisks--;
 			pd->pd_updated = 1;
 		}
@@ -650,7 +650,7 @@ g_raid_md_promise_start_disk(struct g_ra
 			free(pd->pd_meta[sdn], M_MD_PROMISE);
 			for (i = sdn; i < pd->pd_subdisks - 1; i++)
 				pd->pd_meta[i] = pd->pd_meta[i + 1];
-			pd->pd_meta[PROMISE_MAX_SUBDISKS - 1] = NULL;
+			pd->pd_meta[pd->pd_subdisks - 1] = NULL;
 			pd->pd_subdisks--;
 		}
 		/* If we are in the start process, that's all for now. */
@@ -1094,7 +1094,7 @@ g_raid_md_taste_promise(struct g_raid_md
 		free(metaarr[i], M_MD_PROMISE);
 		for (j = i; j < subdisks - 1; j++)
 			metaarr[i] = metaarr[j + 1];
-		metaarr[PROMISE_MAX_SUBDISKS - 1] = NULL;
+		metaarr[subdisks - 1] = NULL;
 		subdisks--;
 	}
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201210102041.q9AKfc6R096458>