Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F139410470
D15285.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D15285.diff
View Options
Index: head/sys/net/iflib.c
===================================================================
--- head/sys/net/iflib.c
+++ head/sys/net/iflib.c
@@ -4777,11 +4777,8 @@
KASSERT(ntxqs > 0, ("number of queues per qset must be at least 1"));
KASSERT(nrxqs > 0, ("number of queues per qset must be at least 1"));
- txq = NULL;
- rxq = NULL;
-
/* Allocate the TX ring struct memory */
- if (!(txq =
+ if (!(ctx->ifc_txqs =
(iflib_txq_t) malloc(sizeof(struct iflib_txq) *
ntxqsets, M_IFLIB, M_NOWAIT | M_ZERO))) {
device_printf(dev, "Unable to allocate TX ring memory\n");
@@ -4790,7 +4787,7 @@
}
/* Now allocate the RX */
- if (!(rxq =
+ if (!(ctx->ifc_rxqs =
(iflib_rxq_t) malloc(sizeof(struct iflib_rxq) *
nrxqsets, M_IFLIB, M_NOWAIT | M_ZERO))) {
device_printf(dev, "Unable to allocate RX ring memory\n");
@@ -4798,8 +4795,8 @@
goto rx_fail;
}
- ctx->ifc_txqs = txq;
- ctx->ifc_rxqs = rxq;
+ txq = ctx->ifc_txqs;
+ rxq = ctx->ifc_rxqs;
/*
* XXX handle allocation failure
@@ -4957,17 +4954,13 @@
/* XXX handle allocation failure changes */
err_rx_desc:
err_tx_desc:
+rx_fail:
if (ctx->ifc_rxqs != NULL)
free(ctx->ifc_rxqs, M_IFLIB);
ctx->ifc_rxqs = NULL;
if (ctx->ifc_txqs != NULL)
free(ctx->ifc_txqs, M_IFLIB);
ctx->ifc_txqs = NULL;
-rx_fail:
- if (rxq != NULL)
- free(rxq, M_IFLIB);
- if (txq != NULL)
- free(txq, M_IFLIB);
fail:
return (err);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Dec 12, 6:54 PM (1 h, 28 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
26909240
Default Alt Text
D15285.diff (1 KB)
Attached To
Mode
D15285: iflib: fix invalid free during queue allocation failure
Attached
Detach File
Event Timeline
Log In to Comment