]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - net/ipv4/ipcomp.c
Fix crypto_alloc_comp() error checking.
[karo-tx-linux.git] / net / ipv4 / ipcomp.c
index e787044a85148ebceaafdbb964c7dd15c2e99daa..a8a9f13a300965105f0b07c33efaf83612059d1c 100644 (file)
@@ -17,6 +17,7 @@
 #include <asm/scatterlist.h>
 #include <asm/semaphore.h>
 #include <linux/crypto.h>
+#include <linux/err.h>
 #include <linux/pfkeyv2.h>
 #include <linux/percpu.h>
 #include <linux/smp.h>
@@ -355,7 +356,7 @@ static struct crypto_comp **ipcomp_alloc_tfms(const char *alg_name)
        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;
        }