[ipxe-devel] [ipxe/ipxe] [infiniband] fix a memory leak in ib_refill_recv (#87)

Ignat Korchagin notifications at github.com
Mon Jan 7 13:19:04 UTC 2019


While debugging another issue (my UEFI firmware continuously polling the iPXE
option ROM on a Mellanox ConnectX-4 Lx) I noticed that iPXE quickly runs out of
memory. Tracing the code led me to ib_refill_recv. We can see that
ib_refill_recv allocated an iobuf and hands it over to a driver-specific
post-receive hook. However, ib_refill_recv free's the iobuf only, when the hook
returns an error and none of the implementations free the iobuf on success.

So it seems that ib_refill_recv should unconditionally free the iobuf before
processing the error code from the hook (this patch fixed the leak for me at
least).
You can view, comment on, or merge this pull request online at:

  https://github.com/ipxe/ipxe/pull/87

-- Commit Summary --

  * [infiniband] fix a memory leak in ib_refill_recv

-- File Changes --

    M src/net/infiniband.c (5)

-- Patch Links --

https://github.com/ipxe/ipxe/pull/87.patch
https://github.com/ipxe/ipxe/pull/87.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/ipxe/ipxe/pull/87
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ipxe.org/pipermail/ipxe-devel/attachments/20190107/2db10718/attachment.htm>


More information about the ipxe-devel mailing list