Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 Jan 2019 14:35:00 +0000 (UTC)
From:      Andrew Gallatin <gallatin@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r343526 - stable/12/sys/net
Message-ID:  <201901281435.x0SEZ08L018294@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201901281435.x0SEZ08L018294>