diff mbox

Allocate only once the EMC-clariion global checker's stage area instead of multiple times.

Message ID 1237908301-2339-4-git-send-email-konrad@virtualiron.com (mailing list archive)
State Accepted, archived
Delegated to: christophe varoqui
Headers show

Commit Message

Konrad Rzeszutek March 24, 2009, 3:25 p.m. UTC
The multi-path global context on every path checker init would be
set. In scenarios where you have four paths per multipath, that context
would be set four times instead of once causing a small memory leak
(4 bytes per block disk).
---
 libmultipath/checkers/emc_clariion.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff mbox

Patch

diff --git a/libmultipath/checkers/emc_clariion.c b/libmultipath/checkers/emc_clariion.c
index 200daee..08c9c26 100644
--- a/libmultipath/checkers/emc_clariion.c
+++ b/libmultipath/checkers/emc_clariion.c
@@ -76,7 +76,7 @@  int libcheck_init (struct checker * c)
 	/*
 	 * Allocate and initialize the multi-path global context.
 	 */
-	if (c->mpcontext) {
+	if (c->mpcontext && *c->mpcontext == NULL) {
 		void * mpctxt = MALLOC(sizeof(int));
 		*c->mpcontext = mpctxt;
 		CLR_INACTIVE_SNAP(c);