ipcomp: fix crypto_alloc_comp() error check
Subsystems (4)
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]>
Signed-off-by Akinobu Mita <[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
@@ -368,7 +368,7 @@ static struct crypto_comp **ipcomp6_allofor_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
@@ -369,7 +369,7 @@ static struct crypto_comp **ipcomp_allocfor_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; }