Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
[powerpc.git] / net / ipv6 / ipcomp6.c
index 00f3fad..4863643 100644 (file)
@@ -208,7 +208,7 @@ static void ipcomp6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
        if (type != ICMPV6_DEST_UNREACH && type != ICMPV6_PKT_TOOBIG)
                return;
 
-       spi = ntohl(ntohs(ipcomph->cpi));
+       spi = htonl(ntohs(ipcomph->cpi));
        x = xfrm_state_lookup((xfrm_address_t *)&iph->daddr, spi, IPPROTO_COMP, AF_INET6);
        if (!x)
                return;
@@ -290,7 +290,7 @@ static void ipcomp6_free_scratches(void)
        if (!scratches)
                return;
 
-       for_each_cpu(i) {
+       for_each_possible_cpu(i) {
                void *scratch = *per_cpu_ptr(scratches, i);
 
                vfree(scratch);
@@ -313,7 +313,7 @@ static void **ipcomp6_alloc_scratches(void)
 
        ipcomp6_scratches = scratches;
 
-       for_each_cpu(i) {
+       for_each_possible_cpu(i) {
                void *scratch = vmalloc(IPCOMP_SCRATCH_SIZE);
                if (!scratch)
                        return NULL;
@@ -344,7 +344,7 @@ static void ipcomp6_free_tfms(struct crypto_tfm **tfms)
        if (!tfms)
                return;
 
-       for_each_cpu(cpu) {
+       for_each_possible_cpu(cpu) {
                struct crypto_tfm *tfm = *per_cpu_ptr(tfms, cpu);
                crypto_free_tfm(tfm);
        }
@@ -384,7 +384,7 @@ static struct crypto_tfm **ipcomp6_alloc_tfms(const char *alg_name)
        if (!tfms)
                goto error;
 
-       for_each_cpu(cpu) {
+       for_each_possible_cpu(cpu) {
                struct crypto_tfm *tfm = crypto_alloc_tfm(alg_name, 0);
                if (!tfm)
                        goto error;