USB: validate wMaxPacketValue entries in endpoint descriptors
[pandora-kernel.git] / net / ipv6 / xfrm6_policy.c
index 05e34c8..db78e7d 100644 (file)
@@ -96,8 +96,10 @@ static int xfrm6_fill_dst(struct xfrm_dst *xdst, struct net_device *dev,
        dev_hold(dev);
 
        xdst->u.rt6.rt6i_idev = in6_dev_get(dev);
-       if (!xdst->u.rt6.rt6i_idev)
+       if (!xdst->u.rt6.rt6i_idev) {
+               dev_put(dev);
                return -ENODEV;
+       }
 
        xdst->u.rt6.rt6i_peer = rt->rt6i_peer;
        if (rt->rt6i_peer)
@@ -124,7 +126,7 @@ _decode_session6(struct sk_buff *skb, struct flowi *fl, int reverse)
        struct flowi6 *fl6 = &fl->u.ip6;
        int onlyproto = 0;
        u16 offset = skb_network_header_len(skb);
-       struct ipv6hdr *hdr = ipv6_hdr(skb);
+       const struct ipv6hdr *hdr = ipv6_hdr(skb);
        struct ipv6_opt_hdr *exthdr;
        const unsigned char *nh = skb_network_header(skb);
        u8 nexthdr = nh[IP6CB(skb)->nhoff];