netdev
[Top] [All Lists]

Re: [PATCH]: r8169: Expose hardware stats via ethtool

To: Francois Romieu <romieu@xxxxxxxxxxxxx>
Subject: Re: [PATCH]: r8169: Expose hardware stats via ethtool
From: Richard Dawe <rich@xxxxxxxxxxxxxxxxxxxx>
Date: Sun, 27 Feb 2005 22:44:20 +0000
Cc: Jon Mason <jdmason@xxxxxxxxxx>, netdev@xxxxxxxxxxx, jgarzik@xxxxxxxxx
In-reply-to: <20050226182658.GB13230@xxxxxxxxxxxxxxxxxxxxxxxxxx>
References: <42208D83.80803@xxxxxxxxxxxxxxxxxxxx> <20050226182658.GB13230@xxxxxxxxxxxxxxxxxxxxxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20041020
Hello.

Francois Romieu wrote:
Richard Dawe <rich@xxxxxxxxxxxxxxxxxxxx> :
[...]

@@ -1531,6 +1620,11 @@ static int rtl8169_open(struct net_devic
        if (retval < 0)
                goto err_free_rx;

+       tp->nic_stats = pci_alloc_consistent(pdev, R8169_STATS_BYTES,
+                                            &tp->nic_stats_addr);
+       if (!tp->nic_stats)
+               goto err_free_nic_stats;
+
        INIT_WORK(&tp->task, NULL, dev);

        rtl8169_hw_start(dev);
@@ -1541,6 +1635,10 @@ static int rtl8169_open(struct net_devic
out:
        return retval;

+err_free_nic_stats:
+       pci_free_consistent(pdev, R8169_STATS_BYTES, tp->nic_stats,
+                           tp->nic_stats_addr);
+


You don't want to free it it was not allocated. Please undo the previous
step (init_ring probably) and:
[snip]

Oops, thanks for spotting that. I'll fix it for the next revision of the patch.

Thanks, bye, Rich =]

--
Richard Dawe [ http://homepages.nildram.co.uk/~phekda/richdawe/ ]

"You can't evaluate a man by logic alone."
  -- McCoy, "I, Mudd", Star Trek

<Prev in Thread] Current Thread [Next in Thread>