Re: [PATCH net v2 07/12] net: au1000: fix buffer descriptor free list insertion
From: netdev-bot+sashiko
Date: Mon Nov 16 2026 - 08:52:05 EST
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] The commit message for "net: au1000: fix buffer descriptor free
list insertion" says the old au1000_ReleaseDB() "loses free…
--
net: au1000: fix buffer descriptor free list insertion
This patch changes au1000_ReleaseDB() so the returned descriptor's pnext
points to the old free list head before it becomes the new head. Before
this, the old head's pnext was set to the returned descriptor. The new
code matches au1000_GetFreeDB() and how the list is set up in probe.
> ReleaseDB links the old head to the returned descriptor and makes the
> returned descriptor the new head without updating its stale next
> pointer. This loses free descriptors and can create cycles. Link the
> returned descriptor to the old head instead, matching GetFreeDB and the
> list initialization.
>
> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
[Severity: Low]
The code change looks correct. Should the commit message say that the old
behaviour had no runtime effect, though?
au1000_ReleaseDB() is only called on teardown paths: the err_out unwind
in au1000_probe() and au1000_remove(). In both cases the descriptor
buffers and aup are freed right afterwards:
drivers/net/ethernet/amd/au1000_eth.c:au1000_remove() {
...
for (i = 0; i < NUM_RX_DMA; i++)
if (aup->rx_db_inuse[i])
au1000_ReleaseDB(aup, aup->rx_db_inuse[i]);
for (i = 0; i < NUM_TX_DMA; i++)
if (aup->tx_db_inuse[i])
au1000_ReleaseDB(aup, aup->tx_db_inuse[i]);
dma_free_coherent(&pdev->dev, MAX_BUF_SIZE * (NUM_TX_BUFFS + NUM_RX_BUFFS),
aup->vaddr, aup->dma_addr);
...
free_netdev(dev);
}
The err_out path in au1000_probe() also falls through to
dma_free_coherent() and free_netdev().
au1000_GetFreeDB() is only called from au1000_probe(), before any
au1000_ReleaseDB() call, and no RX or TX path walks aup->pDBfree. Also,
NUM_RX_BUFFS equals NUM_RX_DMA and NUM_TX_BUFFS equals NUM_TX_DMA, so
the free list is already empty after a successful probe.
So the lost entries or cycles only ever exist in a list that is about to
be freed and is never read again. With the Fixes: tag, stable tooling
could pick this up as a user-visible fix.
Could the message say the bug is latent with no functional impact, and
either drop the Fixes: tag or explain why it is needed?
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261112045301.3669532-1-f.fainelli%40gmail.com