]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
bnx2x: Overstepping array bounds
authorEilon Greenstein <eilong@broadcom.com>
Wed, 14 Jan 2009 06:44:10 +0000 (06:44 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 20 Jan 2009 00:20:11 +0000 (16:20 -0800)
If the page size is > 8KB this violation happens

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/bnx2x_main.c

index ca5090c3341ee8a6c33994a1ae88c894b7c65cdf..2e00da6ab172977734c101c97224d8154a9dc04d 100644 (file)
@@ -9427,6 +9427,7 @@ static inline u32 bnx2x_xmit_type(struct bnx2x *bp, struct sk_buff *skb)
        return rc;
 }
 
+#if (MAX_SKB_FRAGS >= MAX_FETCH_BD - 3)
 /* check if packet requires linearization (packet is too fragmented) */
 static int bnx2x_pkt_req_lin(struct bnx2x *bp, struct sk_buff *skb,
                             u32 xmit_type)
@@ -9504,6 +9505,7 @@ exit_lbl:
 
        return to_copy;
 }
+#endif
 
 /* called with netif_tx_lock
  * bnx2x_tx_int() runs without netif_tx_lock unless it needs to call
@@ -9544,6 +9546,7 @@ static int bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev)
           skb->ip_summed, skb->protocol, ipv6_hdr(skb)->nexthdr,
           ip_hdr(skb)->protocol, skb_shinfo(skb)->gso_type, xmit_type);
 
+#if (MAX_SKB_FRAGS >= MAX_FETCH_BD - 3)
        /* First, check if we need to linearize the skb
           (due to FW restrictions) */
        if (bnx2x_pkt_req_lin(bp, skb, xmit_type)) {
@@ -9556,6 +9559,7 @@ static int bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev)
                        return NETDEV_TX_OK;
                }
        }
+#endif
 
        /*
        Please read carefully. First we use one BD which we mark as start,