tunneling: Check refcount of each page in frags.
[sliver-openvswitch.git] / datapath / tunnel.c
index 40577fb..95492f7 100644 (file)
@@ -1021,7 +1021,7 @@ static inline bool need_linearize(const struct sk_buff *skb)
         * change them from underneath us and we can skip the linearization.
         */
        for (i = 0; i < skb_shinfo(skb)->nr_frags; i++)
-               if (unlikely(page_count(skb_shinfo(skb)->frags[0].page) > 1))
+               if (unlikely(page_count(skb_shinfo(skb)->frags[i].page) > 1))
                        return true;
 
        return false;