]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/ipv6/ipcomp6.c
[Blackfin] arch: Fix bug to Enable bf548 to Re-program Clocks while Kernel boots.
[linux-2.6-omap-h63xx.git] / net / ipv6 / ipcomp6.c
index 28fc8edfdc3aa63f24f85df71869809d27df7e71..0cd4056f9127e3434cbb63ed27ebcaddb404f54c 100644 (file)
@@ -34,9 +34,9 @@
 #include <net/ip.h>
 #include <net/xfrm.h>
 #include <net/ipcomp.h>
-#include <asm/scatterlist.h>
 #include <asm/semaphore.h>
 #include <linux/crypto.h>
+#include <linux/err.h>
 #include <linux/pfkeyv2.h>
 #include <linux/random.h>
 #include <linux/percpu.h>
@@ -359,7 +359,7 @@ static struct crypto_comp **ipcomp6_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;
        }
@@ -411,8 +411,15 @@ static int ipcomp6_init_state(struct xfrm_state *x)
                goto out;
 
        x->props.header_len = 0;
-       if (x->props.mode == XFRM_MODE_TUNNEL)
+       switch (x->props.mode) {
+       case XFRM_MODE_BEET:
+       case XFRM_MODE_TRANSPORT:
+               break;
+       case XFRM_MODE_TUNNEL:
                x->props.header_len += sizeof(struct ipv6hdr);
+       default:
+               goto error;
+       }
 
        mutex_lock(&ipcomp6_resource_mutex);
        if (!ipcomp6_alloc_scratches())