[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20090528211540.2A5BAFC2BD@magilla.sf.frob.com>
Date: Thu, 28 May 2009 14:15:40 -0700 (PDT)
From: Roland McGrath <roland@...hat.com>
To: Oleg Nesterov <oleg@...hat.com>
Cc: Christoph Hellwig <hch@...radead.org>, Ingo Molnar <mingo@...e.hu>,
linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH 4/12 v2] ptrace: introduce the empty "struct
ptrace_context"
> + task_lock(tsk);
> + if (likely(!tsk->ptrace_ctx))
> + tsk->ptrace_ctx = ptrace_ctx;
> + else
> + kfree(ptrace_ctx);
> + task_unlock(tsk);
I don't think it's kosher call kfree with task_lock() held.
The kfree case is a very unlikely path, so it can be:
task_lock(tsk);
if (likely(!tsk->ptrace_ctx)) {
tsk->ptrace_ctx = ptrace_ctx;
task_unlock(tsk);
return 0;
}
task_unlock(tsk);
kfree(ptrace_ctx);
Thanks,
Roland
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists