public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kernel/cred: Fix bug on cred reference count
@ 2011-07-09  6:49 Edwin van Vliet
  2011-07-09  9:13 ` David Howells
  0 siblings, 1 reply; 2+ messages in thread
From: Edwin van Vliet @ 2011-07-09  6:49 UTC (permalink / raw)
  To: dhowells; +Cc: akpm, linux-kernel, Edwin van Vliet

The comment above states that the old obj ref and subj ref should BOTH be
released. However, the line is repeated so the old obj ref is released twice
yet the subj ref is not. So either the comment is wrong, or this is simpy a
bug. Releasing the same ref twice seems wrong in any case.

Signed-off-by: Edwin van Vliet <edwin@cheatah.nl>
---
 kernel/cred.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/cred.c b/kernel/cred.c
index 174fa84..2492f08 100644
--- a/kernel/cred.c
+++ b/kernel/cred.c
@@ -537,7 +537,7 @@ int commit_creds(struct cred *new)
 
 	/* release the old obj and subj refs both */
 	put_cred(old);
-	put_cred(old);
+	put_cred(new);
 	return 0;
 }
 EXPORT_SYMBOL(commit_creds);
-- 
1.7.5.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-07-09  9:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-09  6:49 [PATCH] kernel/cred: Fix bug on cred reference count Edwin van Vliet
2011-07-09  9:13 ` David Howells

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox