Commit 734d4e1
sfc: Fix memory leak when discarding scattered packets
Commit 2768935 ('sfc: reuse pages to avoid DMA mapping/unmapping
costs') did not fully take account of DMA scattering which was
introduced immediately before. If a received packet is invalid and
must be discarded, we only drop a reference to the first buffer's
page, but we need to drop a reference for each buffer the packet
used.
I think this bug was missed partly because efx_recycle_rx_buffers()
was not renamed and so no longer does what its name says. It does not
change the state of buffers, but only prepares the underlying pages
for recycling. Rename it accordingly.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>1 parent 86bd68b commit 734d4e1
1 file changed
Lines changed: 20 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
282 | 282 | | |
283 | 283 | | |
284 | 284 | | |
285 | | - | |
286 | | - | |
287 | | - | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
288 | 288 | | |
289 | 289 | | |
290 | 290 | | |
| |||
294 | 294 | | |
295 | 295 | | |
296 | 296 | | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
297 | 311 | | |
298 | 312 | | |
299 | 313 | | |
| |||
533 | 547 | | |
534 | 548 | | |
535 | 549 | | |
536 | | - | |
537 | | - | |
| 550 | + | |
538 | 551 | | |
539 | 552 | | |
540 | 553 | | |
| |||
570 | 583 | | |
571 | 584 | | |
572 | 585 | | |
573 | | - | |
| 586 | + | |
574 | 587 | | |
575 | | - | |
| 588 | + | |
576 | 589 | | |
577 | 590 | | |
578 | 591 | | |
| |||
0 commit comments