ipv4: ip_check_defrag should correctly check return value of skb_copy_bits
[firefly-linux-kernel-4.4.55.git] / net / ipv4 / ip_fragment.c
index b66910aaef4d633977d2e983f2c63b419da38f77..5fff3d466e90d3e37d6b560c1938c2f55a3cb845 100644 (file)
@@ -683,7 +683,7 @@ struct sk_buff *ip_check_defrag(struct sk_buff *skb, u32 user)
        if (skb->protocol != htons(ETH_P_IP))
                return skb;
 
-       if (!skb_copy_bits(skb, 0, &iph, sizeof(iph)))
+       if (skb_copy_bits(skb, 0, &iph, sizeof(iph)) < 0)
                return skb;
 
        if (iph.ihl < 5 || iph.version != 4)