archive mirror
 help / color / mirror / Atom feed
Subject: [PATCH] Memory Leak fix for ibmtr
Date: Thu, 1 Mar 2001 13:11:47 -0500	[thread overview]
Message-ID: <> (raw)

Here is a small patch that fixes a memory leak in the ibmtr driver. 

Basically the bug occurs because the skb->tail pointer is set past the end 
of the skb data buffer. This causes problems when the skb's are cloned 
(they are unabled to be freed properly). The result is a leak that 
eventually will stop the system. 

Mike Phillips
Linux Token Ring Project 

--- linux.orig/drivers/net/tokenring/ibmtr.c    Wed Feb 14 16:49:55 2001
+++ linux/drivers/net/tokenring/ibmtr.c Wed Feb 14 16:50:01 2001
@@ -1716,7 +1716,8 @@
-               skb_size = length;
+       skb_size=(sizeof(struct trh_hdr)-lan_hdr_len+sizeof(struct 
trllc)+15) & ~15;
+               skb_size+=length;
                if (!(skb=dev_alloc_skb(skb_size))) {
                        DPRINTK("out of memory. frame dropped.\n");
@@ -1727,8 +1728,8 @@
-       skb_put(skb, length);
-       skb_reserve(skb, sizeof(struct trh_hdr)-lan_hdr_len+sizeof(struct 
+       skb_reserve(skb, (sizeof(struct trh_hdr)-lan_hdr_len+sizeof(struct 
trllc)+15) & ~15);
+       skb_put(skb,length);
        rbuffer_len=ntohs(isa_readw(rbuffer + offsetof(struct rec_buf, 

                 reply	other threads:[~2001-03-01 18:50 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \
    --subject='Re: [PATCH] Memory Leak fix for ibmtr' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
on how to clone and mirror all data and code used for this inbox