[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <29992.1295966140@redhat.com>
Date: Tue, 25 Jan 2011 14:35:40 +0000
From: David Howells <dhowells@...hat.com>
To: Davidlohr Bueso <dave@....org>
Cc: dhowells@...hat.com, LKML <linux-kernel@...r.kernel.org>,
keyrings@...ux-nfs.org
Subject: Re: [PATCH] security: keyring: remove redundant NULL check
Davidlohr Bueso <dave@....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
--
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