mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Edwin van Vliet <edwin@cheatah.nl>
To: dhowells@redhat.com
Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
	Edwin van Vliet <edwin@cheatah.nl>
Subject: [PATCH] kernel/cred: Fix bug on cred reference count
Date: Sat,  9 Jul 2011 08:49:01 +0200	[thread overview]
Message-ID: <1310194141-18700-1-git-send-email-edwin@cheatah.nl> (raw)

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


             reply	other threads:[~2011-07-09  6:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-09  6:49 Edwin van Vliet [this message]
2011-07-09  9:13 ` David Howells

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=1310194141-18700-1-git-send-email-edwin@cheatah.nl \
    --to=edwin@cheatah.nl \
    --cc=akpm@linux-foundation.org \
    --cc=dhowells@redhat.com \
    --cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome