summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-07-08 18:10:51 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-08 18:10:51 -0700
commitf1d407efbe59ff1a450f0ec7a486a768acaa2949 (patch)
treea481b317df865e4f19ed0e797ac57a0bfe2233e3
parent7683c57c489bd17795945f4ae1c1d73e7c7b38e3 (diff)
parentdbb018cd8a0fd073eaabf9de5a93f62d98bd7723 (diff)
downloadlinux-f1d407efbe59ff1a450f0ec7a486a768acaa2949.tar.gz
linux-f1d407efbe59ff1a450f0ec7a486a768acaa2949.tar.bz2
linux-f1d407efbe59ff1a450f0ec7a486a768acaa2949.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: crypto: tcrypt - Fix memory leak in test_cipher
-rw-r--r--crypto/tcrypt.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c
index 6beabc5abd07..e47f6e02133c 100644
--- a/crypto/tcrypt.c
+++ b/crypto/tcrypt.c
@@ -586,12 +586,6 @@ static void test_cipher(char *algo, int enc,
j = 0;
for (i = 0; i < tcount; i++) {
- data = kzalloc(template[i].ilen, GFP_KERNEL);
- if (!data)
- continue;
-
- memcpy(data, template[i].input, template[i].ilen);
-
if (template[i].iv)
memcpy(iv, template[i].iv, MAX_IVLEN);
else
@@ -613,10 +607,8 @@ static void test_cipher(char *algo, int enc,
printk("setkey() failed flags=%x\n",
crypto_ablkcipher_get_flags(tfm));
- if (!template[i].fail) {
- kfree(data);
+ if (!template[i].fail)
goto out;
- }
}
temp = 0;