mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Giangiacomo Mariotti <giangiacomo.mariotti@gmail.com>
To: linux-kernel@vger.kernel.org
Subject: [PATCH] Possible memory leak in arch/cris/arch-v32/drivers/cryptocop.c
Date: Thu, 11 Jun 2009 18:30:17 +0200	[thread overview]
Message-ID: <2aac3c260906110930k49d70eb9o9922795a5bfdadf8@mail.gmail.com> (raw)

>From ee8e71f0ae1356b324906efc8e858b29025c60ef Mon Sep 17 00:00:00 2001
From: Giangiacomo Mariotti <giangiacomo.mariotti@gmail.com>
Date: Thu, 11 Jun 2009 18:13:52 +0200
Subject: [PATCH] Possible mem leak

---
 arch/cris/arch-v32/drivers/cryptocop.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/cris/arch-v32/drivers/cryptocop.c
b/arch/cris/arch-v32/drivers/cryptocop.c
index 67c61ea..fd529a0 100644
--- a/arch/cris/arch-v32/drivers/cryptocop.c
+++ b/arch/cris/arch-v32/drivers/cryptocop.c
@@ -1395,7 +1395,7 @@ static int create_md5_pad(int alloc_flag,
unsigned long long hashed_length, char
 	if (padlen < MD5_MIN_PAD_LENGTH) padlen += MD5_BLOCK_LENGTH;

 	p = kmalloc(padlen, alloc_flag);
-	if (!pad) return -ENOMEM;
+	if (!p) return -ENOMEM;

 	*p = 0x80;
 	memset(p+1, 0, padlen - 1);
@@ -1427,7 +1427,7 @@ static int create_sha1_pad(int alloc_flag,
unsigned long long hashed_length, cha
 	if (padlen < SHA1_MIN_PAD_LENGTH) padlen += SHA1_BLOCK_LENGTH;

 	p = kmalloc(padlen, alloc_flag);
-	if (!pad) return -ENOMEM;
+	if (!p) return -ENOMEM;

 	*p = 0x80;
 	memset(p+1, 0, padlen - 1);
--

-- 
You highest men whom my eyes have seen, this is my doubt about you and
my secret laughter: I guess that you would call my overman—devil!
What is great is so alien to your souls that the overman would be
terrifying to you in his goodness ...

             reply	other threads:[~2009-06-11 16:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-11 16:30 Giangiacomo Mariotti [this message]
2009-06-11 17:32 ` Jesper Nilsson

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=2aac3c260906110930k49d70eb9o9922795a5bfdadf8@mail.gmail.com \
    --to=giangiacomo.mariotti@gmail.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

all inboxes | Powered by JetHome®