projects
/
GitHub
/
LineageOS
/
android_kernel_samsung_universal7580.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
46f8153
)
[CRYPTO] cryptd: Correct kzalloc error test
author
Julia Lawall
<julia@diku.dk>
Tue, 29 Apr 2008 16:27:14 +0000
(
00:27
+0800)
committer
Herbert Xu
<herbert@gondor.apana.org.au>
Thu, 1 May 2008 10:22:28 +0000
(18:22 +0800)
Normally, kzalloc returns NULL or a valid pointer value, not a value to be
tested using IS_ERR.
Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/cryptd.c
patch
|
blob
|
blame
|
history
diff --git
a/crypto/cryptd.c
b/crypto/cryptd.c
index 250425263e00e59fad2b5a11436ce5a02b9dbe41..b150de562057f59bd85a69f0bb4e3267589c6bff 100644
(file)
--- a/
crypto/cryptd.c
+++ b/
crypto/cryptd.c
@@
-190,8
+190,10
@@
static struct crypto_instance *cryptd_alloc_instance(struct crypto_alg *alg,
int err;
inst = kzalloc(sizeof(*inst) + sizeof(*ctx), GFP_KERNEL);
- if (IS_ERR(inst))
+ if (!inst) {
+ inst = ERR_PTR(-ENOMEM);
goto out;
+ }
err = -ENAMETOOLONG;
if (snprintf(inst->alg.cra_driver_name, CRYPTO_MAX_ALG_NAME,