svn commit: r343526 - stable/12/sys/net

Andrew Gallatin gallatin at FreeBSD.org
Mon Jan 28 14:35:00 UTC 2019


Author: gallatin
Date: Mon Jan 28 14:34:59 2019
New Revision: 343526
URL: https://svnweb.freebsd.org/changeset/base/343526

Log:
  MFC r343430
  
    Fix an iflib driver unload panic introduced in r343085
  
    The new loop to sync and unload descriptors was indexed
    by "i", rather than "j".   The panic was caused by "i"
    being advanced rather than "j", and eventually becoming
    out of bounds.
  
  Reviewed by:	kib
  Sponsored by:	Netflix

Modified:
  stable/12/sys/net/iflib.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/net/iflib.c
==============================================================================
--- stable/12/sys/net/iflib.c	Mon Jan 28 12:45:31 2019	(r343525)
+++ stable/12/sys/net/iflib.c	Mon Jan 28 14:34:59 2019	(r343526)
@@ -2192,17 +2192,17 @@ iflib_rx_sds_free(iflib_rxq_t rxq)
 			fl = &rxq->ifr_fl[i];
 			if (fl->ifl_desc_tag != NULL) {
 				if (fl->ifl_sds.ifsd_map != NULL) {
-					for (j = 0; j < fl->ifl_size; i++) {
-						if (fl->ifl_sds.ifsd_map[i] ==
+					for (j = 0; j < fl->ifl_size; j++) {
+						if (fl->ifl_sds.ifsd_map[j] ==
 						    NULL)
-						continue;
+							continue;
 						bus_dmamap_sync(
 						    fl->ifl_desc_tag,
-						    fl->ifl_sds.ifsd_map[i],
+						    fl->ifl_sds.ifsd_map[j],
 						    BUS_DMASYNC_POSTREAD);
 						bus_dmamap_unload(
 						    fl->ifl_desc_tag,
-						    fl->ifl_sds.ifsd_map[i]);
+						    fl->ifl_sds.ifsd_map[j]);
 					}
 				}
 				bus_dma_tag_destroy(fl->ifl_desc_tag);


More information about the svn-src-all mailing list