MCPcopy Create free account
hub / github.com/CloverHackyColor/CloverBootloader / NetbufFree

Function NetbufFree

NetworkPkg/Library/DxeNetLib/NetBuffer.c:197–217  ·  view source on GitHub ↗

Free the net buffer and its associated NET_VECTOR. Decrease the reference count of the net buffer by one. Free the associated net vector and itself if the reference count of the net buffer is decreased to 0. The net vector free operation just decrease the reference count of the net vector by one and do the real resource free operation when the reference count of the net vector is

Source from the content-addressed store, hash-verified

195
196**/
197VOID
198EFIAPI
199NetbufFree (
200 IN NET_BUF *Nbuf
201 )
202{
203 ASSERT (Nbuf != NULL);
204 NET_CHECK_SIGNATURE (Nbuf, NET_BUF_SIGNATURE);
205 ASSERT (Nbuf->RefCnt > 0);
206
207 Nbuf->RefCnt--;
208
209 if (Nbuf->RefCnt == 0) {
210 //
211 // Update Vector only when NBuf is to be released. That is,
212 // all the sharing of Nbuf increse Vector's RefCnt by one
213 //
214 NetbufFreeVector (Nbuf->Vector);
215 FreePool (Nbuf);
216 }
217}
218
219
220/**

Callers 15

NetbufFreeListFunction · 0.70
NetbufQueTrimFunction · 0.70
TlsConnectSessionFunction · 0.50
TlsCloseSessionFunction · 0.50
HttpsReceiveFunction · 0.50
TcpResetConnectionFunction · 0.50
TcpGetSegmentSndQueFunction · 0.50
TcpGetSegmentFunction · 0.50
TcpRetransmitFunction · 0.50
TcpToSendDataFunction · 0.50
TcpSendAckFunction · 0.50
TcpSendZeroProbeFunction · 0.50

Calls 2

NetbufFreeVectorFunction · 0.70
FreePoolFunction · 0.50

Tested by

no test coverage detected