aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bnx2x_main.c
diff options
context:
space:
mode:
authorEilon Greenstein <eilong@broadcom.com>2009-01-14 01:44:10 -0500
committerDavid S. Miller <davem@davemloft.net>2009-01-19 19:20:11 -0500
commit632da4d66324b5baf947a048dd1f1e9093b6dd90 (patch)
tree11e07d6db660761d36d0ff12ec6088b28a053bba /drivers/net/bnx2x_main.c
parent2add3acb11a26cc14b54669433ae6ace6406cbf2 (diff)
bnx2x: Overstepping array bounds
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>
Diffstat (limited to 'drivers/net/bnx2x_main.c')
-rw-r--r--drivers/net/bnx2x_main.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/bnx2x_main.c b/drivers/net/bnx2x_main.c
index ca5090c3341e..2e00da6ab172 100644
--- a/drivers/net/bnx2x_main.c
+++ b/drivers/net/bnx2x_main.c
@@ -9427,6 +9427,7 @@ static inline u32 bnx2x_xmit_type(struct bnx2x *bp, struct sk_buff *skb)
9427 return rc; 9427 return rc;
9428} 9428}
9429 9429
9430#if (MAX_SKB_FRAGS >= MAX_FETCH_BD - 3)
9430/* check if packet requires linearization (packet is too fragmented) */ 9431/* check if packet requires linearization (packet is too fragmented) */
9431static int bnx2x_pkt_req_lin(struct bnx2x *bp, struct sk_buff *skb, 9432static int bnx2x_pkt_req_lin(struct bnx2x *bp, struct sk_buff *skb,
9432 u32 xmit_type) 9433 u32 xmit_type)
@@ -9504,6 +9505,7 @@ exit_lbl:
9504 9505
9505 return to_copy; 9506 return to_copy;
9506} 9507}
9508#endif
9507 9509
9508/* called with netif_tx_lock 9510/* called with netif_tx_lock
9509 * bnx2x_tx_int() runs without netif_tx_lock unless it needs to call 9511 * 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)
9544 skb->ip_summed, skb->protocol, ipv6_hdr(skb)->nexthdr, 9546 skb->ip_summed, skb->protocol, ipv6_hdr(skb)->nexthdr,
9545 ip_hdr(skb)->protocol, skb_shinfo(skb)->gso_type, xmit_type); 9547 ip_hdr(skb)->protocol, skb_shinfo(skb)->gso_type, xmit_type);
9546 9548
9549#if (MAX_SKB_FRAGS >= MAX_FETCH_BD - 3)
9547 /* First, check if we need to linearize the skb 9550 /* First, check if we need to linearize the skb
9548 (due to FW restrictions) */ 9551 (due to FW restrictions) */
9549 if (bnx2x_pkt_req_lin(bp, skb, xmit_type)) { 9552 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)
9556 return NETDEV_TX_OK; 9559 return NETDEV_TX_OK;
9557 } 9560 }
9558 } 9561 }
9562#endif
9559 9563
9560 /* 9564 /*
9561 Please read carefully. First we use one BD which we mark as start, 9565 Please read carefully. First we use one BD which we mark as start,