From: David Howells <dhowells@redhat.com>
To: Davidlohr Bueso <dave@gnu.org>
Cc: dhowells@redhat.com, LKML <linux-kernel@vger.kernel.org>,
keyrings@linux-nfs.org
Subject: Re: [PATCH] security: keyring: remove redundant NULL check
Date: Tue, 25 Jan 2011 14:35:40 +0000 [thread overview]
Message-ID: <29992.1295966140@redhat.com> (raw)
In-Reply-To: <1295883437.2156.1.camel@offworld>
Davidlohr Bueso <dave@gnu.org> wrote:
> - if (prealloc) {
> - kfree(prealloc);
> - key_payload_reserve(keyring,
> - keyring->datalen - KEYQUOTA_LINK_BYTES);
> - }
> + kfree(prealloc);
> + key_payload_reserve(keyring,
> + keyring->datalen - KEYQUOTA_LINK_BYTES);
> +
This is not correct, since you'd be removing the quota allocation for the new
link in the case that __key_link() was called (and cleared *_prealloc).
However, the upstream code isn't correct either, since the preallocation may
not have extended the reservation at all (if it decided to displace a key
rather than adding a key).
David
prev parent reply other threads:[~2011-01-25 14:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-24 15:37 [PATCH] security: keyring: remove redundant NULL check Davidlohr Bueso
2011-01-25 14:35 ` David Howells [this message]
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=29992.1295966140@redhat.com \
--to=dhowells@redhat.com \
--cc=dave@gnu.org \
--cc=keyrings@linux-nfs.org \
--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 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.