public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ecryptfs: bad allocation result check
@ 2006-11-03 19:51 Florin Malita
  2006-11-03 20:02 ` Michael Halcrow
  0 siblings, 1 reply; 2+ messages in thread
From: Florin Malita @ 2006-11-03 19:51 UTC (permalink / raw)
  To: mhalcrow, phillip; +Cc: linux-kernel, Andrew Morton

The kmalloc() result in* *ecryptfs_crypto_api_algify_cipher_name() is
assigned to an indirectly referenced pointer and not to the pointer
itself, so the current result check is incorrect.

Signed-off-by: Florin Malita <fmalita@gmail.com>
---

 crypto.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ecryptfs/crypto.c b/fs/ecryptfs/crypto.c
index f49f105..136175a 100644
--- a/fs/ecryptfs/crypto.c
+++ b/fs/ecryptfs/crypto.c
@@ -134,7 +134,7 @@ int ecryptfs_crypto_api_algify_cipher_na
 
 	algified_name_len = (chaining_modifier_len + cipher_name_len + 3);
 	(*algified_name) = kmalloc(algified_name_len, GFP_KERNEL);
-	if (!(algified_name)) {
+	if (!(*algified_name)) {
 		rc = -ENOMEM;
 		goto out;
 	}



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

* Re: [PATCH] ecryptfs: bad allocation result check
  2006-11-03 19:51 [PATCH] ecryptfs: bad allocation result check Florin Malita
@ 2006-11-03 20:02 ` Michael Halcrow
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Halcrow @ 2006-11-03 20:02 UTC (permalink / raw)
  To: Florin Malita; +Cc: phillip, linux-kernel, Andrew Morton

On Fri, Nov 03, 2006 at 02:51:22PM -0500, Florin Malita wrote:
> The kmalloc() result in* *ecryptfs_crypto_api_algify_cipher_name()
> is assigned to an indirectly referenced pointer and not to the
> pointer itself, so the current result check is incorrect.

Thanks; this bug was already caught and fixed.

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

end of thread, other threads:[~2006-11-03 20:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-03 19:51 [PATCH] ecryptfs: bad allocation result check Florin Malita
2006-11-03 20:02 ` Michael Halcrow

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