netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 28/34]bnx2x: Overstepping array bounds
@ 2009-01-14 16:44 Eilon Greenstein
  2009-01-18  7:23 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Eilon Greenstein @ 2009-01-14 16:44 UTC (permalink / raw)
  To: David Miller, netdev

If the page size is > 8KB this violation happens

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
---
 drivers/net/bnx2x_main.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/net/bnx2x_main.c b/drivers/net/bnx2x_main.c
index 0a18af0..cc83388 100644
--- a/drivers/net/bnx2x_main.c
+++ b/drivers/net/bnx2x_main.c
@@ -9466,6 +9466,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)
@@ -9543,6 +9544,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
@@ -9583,6 +9585,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)) {
@@ -9595,6 +9598,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,
-- 
1.5.4.3





^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 28/34]bnx2x: Overstepping array bounds
  2009-01-14 16:44 [PATCH 28/34]bnx2x: Overstepping array bounds Eilon Greenstein
@ 2009-01-18  7:23 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2009-01-18  7:23 UTC (permalink / raw)
  To: eilong; +Cc: netdev

From: "Eilon Greenstein" <eilong@broadcom.com>
Date: Wed, 14 Jan 2009 18:44:10 +0200

> If the page size is > 8KB this violation happens
> 
> Signed-off-by: Eilon Greenstein <eilong@broadcom.com>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-01-18  7:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-14 16:44 [PATCH 28/34]bnx2x: Overstepping array bounds Eilon Greenstein
2009-01-18  7:23 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).