Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F153193030
D5918.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D5918.diff
View Options
Index: head/sys/dev/e1000/if_em.c
===================================================================
--- head/sys/dev/e1000/if_em.c
+++ head/sys/dev/e1000/if_em.c
@@ -2092,7 +2092,7 @@
txr->tx_tso = FALSE;
}
- if (nsegs > (txr->tx_avail - EM_MAX_SCATTER)) {
+ if (txr->tx_avail < (nsegs + EM_MAX_SCATTER)) {
txr->no_desc_avail++;
bus_dmamap_unload(txr->txtag, map);
return (ENOBUFS);
Index: head/sys/dev/e1000/if_igb.c
===================================================================
--- head/sys/dev/e1000/if_igb.c
+++ head/sys/dev/e1000/if_igb.c
@@ -1887,7 +1887,7 @@
}
/* Make certain there are enough descriptors */
- if (nsegs > txr->tx_avail - 2) {
+ if (txr->tx_avail < (nsegs + 2)) {
txr->no_desc_avail++;
bus_dmamap_unload(txr->txtag, map);
return (ENOBUFS);
Index: head/sys/dev/e1000/if_lem.c
===================================================================
--- head/sys/dev/e1000/if_lem.c
+++ head/sys/dev/e1000/if_lem.c
@@ -1699,7 +1699,7 @@
return (error);
}
- if (nsegs > (adapter->num_tx_desc_avail - 2)) {
+ if (adapter->num_tx_desc_avail < (nsegs + 2)) {
adapter->no_tx_desc_avail2++;
bus_dmamap_unload(adapter->txtag, map);
return (ENOBUFS);
Index: head/sys/dev/ixgbe/ix_txrx.c
===================================================================
--- head/sys/dev/ixgbe/ix_txrx.c
+++ head/sys/dev/ixgbe/ix_txrx.c
@@ -402,7 +402,7 @@
}
/* Make certain there are enough descriptors */
- if (nsegs > txr->tx_avail - 2) {
+ if (txr->tx_avail < (nsegs + 2)) {
txr->no_desc_avail++;
bus_dmamap_unload(txr->txtag, map);
return (ENOBUFS);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Apr 20, 5:34 PM (4 h, 22 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31854104
Default Alt Text
D5918.diff (1 KB)
Attached To
Mode
D5918: Avoid underflow during calculation of space avail for nsegs
Attached
Detach File
Event Timeline
Log In to Comment