All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Serge E. Hallyn" <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
To: Oren Laadan <orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
Cc: Linux Containers <containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org>
Subject: [PATCH] cr: ipc: don't unlock before calling freeary in error path
Date: Fri, 29 May 2009 15:23:06 -0500	[thread overview]
Message-ID: <20090529202306.GA11982@us.ibm.com> (raw)

Else freeary will BUG out.

Signed-off-by: Serge E. Hallyn <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
---
 ipc/checkpoint_sem.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/ipc/checkpoint_sem.c b/ipc/checkpoint_sem.c
index 34dea40..e6934dc 100644
--- a/ipc/checkpoint_sem.c
+++ b/ipc/checkpoint_sem.c
@@ -206,12 +206,11 @@ int restore_ipc_sem(struct ckpt_ctx *ctx)
 	memcpy(sem->sem_base, sma, sem->sem_nsems * sizeof(*sma));
 
 	ret = load_ipc_sem_hdr(ctx, h, sem);
-	ipc_unlock(perms);
-
 	if (ret < 0) {
 		ckpt_debug("sem: need to remove (%d)\n", ret);
 		freeary(current->nsproxy->ipc_ns, perms);
-	}
+	} else
+		ipc_unlock(perms);
 	up_write(&sem_ids->rw_mutex);
  out:
 	kfree(sma);
-- 
1.6.1

             reply	other threads:[~2009-05-29 20:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-29 20:23 Serge E. Hallyn [this message]
     [not found] ` <20090529202306.GA11982-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-05-29 20:46   ` [PATCH] cr: ipc: don't unlock before calling freeary in error path Oren Laadan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090529202306.GA11982@us.ibm.com \
    --to=serue-r/jw6+rmf7hqt0dzr+alfa@public.gmane.org \
    --cc=containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org \
    --cc=orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.