Page MenuHomeFreeBSD

[iwm] Plug memory leak, and fix error handling in iwm_rx_addbuf().
ClosedPublic

Authored by imre_vdsz.com on Jun 7 2016, 12:09 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 24, 3:04 PM
Unknown Object (File)
Sun, Nov 24, 3:04 PM
Unknown Object (File)
Wed, Nov 20, 1:29 AM
Unknown Object (File)
Tue, Nov 19, 11:04 AM
Unknown Object (File)
Oct 19 2024, 9:05 AM
Unknown Object (File)
Oct 1 2024, 12:47 PM
Unknown Object (File)
Sep 30 2024, 11:42 PM
Unknown Object (File)
Sep 27 2024, 5:53 AM
Subscribers

Details

Summary
  • When allocating a new mbuf or bus_dmamap_load()-ing it fails, we can just keep the old mbuf since we are dropping that packet anyway.
  • Instead of doing bus_dmamap_create() and bus_dmamap_destroy() all the time, create an extra bus_dmamap_t which we can use to safely try bus_dmamap_load()-ing the new mbuf. On success we just swap the spare bus_dmamap_t with the data->map of that ring entry.

Obtained from: DragonFlyBSD cc440b26818b5dfdd9af504d71c1b0e6522b53ef

Test Plan

Tested with Intel AC7260, verified with vmstat -m that new kernel no
longer visibly leaks memory from the M_DEVBUF malloc type.
Before, leakage was 1KB every few seconds while ping(8)-ing over the wlan
connection.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

imre_vdsz.com retitled this revision from to [iwm] Plug memory leak, and fix error handling in iwm_rx_addbuf()..
imre_vdsz.com updated this object.
imre_vdsz.com edited the test plan for this revision. (Show Details)
imre_vdsz.com added a reviewer: adrian.

Avoid doing bus_dmamap_create()/_destroy() all the time in iwm_rx_addbuf()

This revision was automatically updated to reflect the committed changes.