[PATCH 6/8] cr: fix memory leak on lsm error on restart

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

 



(this is a bugfix for the patch
cr: checkpoint the active LSM and add RESTART_KEEP_LSM flag
)

Signed-off-by: Serge E. Hallyn <serue@xxxxxxxxxx>
---
 checkpoint/restart.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/checkpoint/restart.c b/checkpoint/restart.c
index 67edf39..f51838b 100644
--- a/checkpoint/restart.c
+++ b/checkpoint/restart.c
@@ -431,7 +431,8 @@ static int restore_read_header(struct ckpt_ctx *ctx)
 		if (strncmp(cur, ctx->lsm_name, SECURITY_NAME_MAX + 1) != 0) {
 			pr_warning("c/r: checkpointed LSM %s, current is %s.\n",
 				ctx->lsm_name, cur);
-			return -EINVAL;
+			ret = -EINVAL;
+			goto out;
 		}
 		/* to be implemented later, per-lsm */
 		if (strcmp(ctx->lsm_name, "lsm_none") != 0 &&
@@ -440,7 +441,8 @@ static int restore_read_header(struct ckpt_ctx *ctx)
 				strcmp(ctx->lsm_name, "default") != 0) {
 			pr_warning("c/r: RESTART_KEEP_LSM unsupported for %s\n",
 					ctx->lsm_name);
-			return -ENOSYS;
+			ret = -ENOSYS;
+			goto out;
 		}
 	}
 
-- 
1.6.1

_______________________________________________
Containers mailing list
Containers@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/containers

[Index of Archives]     [Cgroups]     [Netdev]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux