lkml.org 
[lkml]   [1999]   [Aug]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: 2.2.11: Complicated memory leak...
On Thu, 12 Aug 1999, David S. Miller wrote:

>@@ -982,9 +1042,9 @@
> rtl8129_rx(dev);
>
> if (status & (TxOK | TxErr)) {
>- unsigned int dirty_tx;
>+ unsigned int dirty_tx = tp->dirty_tx;
>
>- for (dirty_tx = tp->dirty_tx; dirty_tx < tp->cur_tx; dirty_tx++) {
>+ while (tp->cur_tx - dirty_tx > 0) {
> int entry = dirty_tx % NUM_TX_DESC;
> int txstatus = inl(ioaddr + TxStatus0 + entry*4);
>
>Unsigned stuff + comparisons against being negative == leak.

reading the above the fix should look like this patch:

--- 2.2.11/drivers/net/rtl8139.c Thu Aug 12 02:32:30 1999
+++ /tmp/rtl8139.c Thu Aug 12 16:54:19 1999
@@ -1044,7 +1044,7 @@
if (status & (TxOK | TxErr)) {
unsigned int dirty_tx = tp->dirty_tx;

- while (tp->cur_tx - dirty_tx > 0) {
+ while (tp->cur_tx > dirty_tx) {
int entry = dirty_tx % NUM_TX_DESC;
int txstatus = inl(ioaddr + TxStatus0 + entry*4);

Andrea


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:53    [W:0.057 / U:0.208 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site