]> Joshua Wise's Git repositories - netwatch.git/commitdiff
Ref only the head of a pbuf chain, instead of the whole thing, to avoid leaking pbufs.
authorJoshua Wise <joshua@rebirth.joshuawise.com>
Sun, 14 Dec 2008 01:32:46 +0000 (20:32 -0500)
committerJoshua Wise <joshua@rebirth.joshuawise.com>
Sun, 14 Dec 2008 01:32:46 +0000 (20:32 -0500)
net/3c90x.c

index 7b6a72eca0d136c020ce29b0ec7eea873b940cef..d405352ebe4b7ba08ce3fde870ef9abdadcead49 100644 (file)
@@ -432,12 +432,12 @@ static void _transmit(struct nic *_nic, struct pbuf *p)
        len = 0;
        n = 0;
        txpbufs[txprod] = p;
        len = 0;
        n = 0;
        txpbufs[txprod] = p;
+       pbuf_ref(p);
        for (; p; p = p->next)
        {
                txdescs[txprod].segments[n].addr = v2p(p->payload);
                txdescs[txprod].segments[n].len = p->len | (p->next ? 0 : (1 << 31));
                len += p->len;
        for (; p; p = p->next)
        {
                txdescs[txprod].segments[n].addr = v2p(p->payload);
                txdescs[txprod].segments[n].len = p->len | (p->next ? 0 : (1 << 31));
                len += p->len;
-               pbuf_ref(p);
                n++;
        }
        txdescs[txprod].hdr = len;      /* If we wanted completion notification, bit 15 */
                n++;
        }
        txdescs[txprod].hdr = len;      /* If we wanted completion notification, bit 15 */
This page took 0.028839 seconds and 4 git commands to generate.