* [PATCH] ipcomp: fix crypto_alloc_comp() error check
@ 2006-11-27 5:07 Akinobu Mita
0 siblings, 0 replies; only message in thread
From: Akinobu Mita @ 2006-11-27 5:07 UTC (permalink / raw)
To: netdev; +Cc: David Miller, Hideaki YOSHIFUJI
The return value of crypto_alloc_comp() should be checked by
IS_ERR().
Cc: David Miller <davem@davemloft.net>
Cc: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
---
net/ipv4/ipcomp.c | 2 +-
net/ipv6/ipcomp6.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
Index: work-fault-inject/net/ipv6/ipcomp6.c
===================================================================
--- work-fault-inject.orig/net/ipv6/ipcomp6.c
+++ work-fault-inject/net/ipv6/ipcomp6.c
@@ -368,7 +368,7 @@ static struct crypto_comp **ipcomp6_allo
for_each_possible_cpu(cpu) {
struct crypto_comp *tfm = crypto_alloc_comp(alg_name, 0,
CRYPTO_ALG_ASYNC);
- if (!tfm)
+ if (IS_ERR(tfm))
goto error;
*per_cpu_ptr(tfms, cpu) = tfm;
}
Index: work-fault-inject/net/ipv4/ipcomp.c
===================================================================
--- work-fault-inject.orig/net/ipv4/ipcomp.c
+++ work-fault-inject/net/ipv4/ipcomp.c
@@ -369,7 +369,7 @@ static struct crypto_comp **ipcomp_alloc
for_each_possible_cpu(cpu) {
struct crypto_comp *tfm = crypto_alloc_comp(alg_name, 0,
CRYPTO_ALG_ASYNC);
- if (!tfm)
+ if (IS_ERR(tfm))
goto error;
*per_cpu_ptr(tfms, cpu) = tfm;
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2006-11-27 5:14 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-27 5:07 [PATCH] ipcomp: fix crypto_alloc_comp() error check Akinobu Mita
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).