Skip to contentSkip to conversation

ipcomp: fix crypto_alloc_comp() error check

PATCH New Akinobu Mita 1 participant 1 message Nov 27, 2006

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ipcomp: fix crypto_alloc_comp() error check

The return value of crypto_alloc_comp() should be checked by IS_ERR().

Cc David Miller <[email protected]>
Cc Hideaki YOSHIFUJI <[email protected]>
---
 net/ipv4/ipcomp.c  |    2 +-
 net/ipv6/ipcomp6.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
net/ipv6/ipcomp6.c +1 -1
Index: 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;
 	}
net/ipv4/ipcomp.c +1 -1
Index: 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;
 	}