Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 Jan 2019 15:02:19 +0000 (UTC)
From:      Andrew Gallatin <gallatin@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r343430 - head/sys/net
Message-ID:  <201901251502.x0PF2JJv030166@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: gallatin
Date: Fri Jan 25 15:02:18 2019
New Revision: 343430
URL: https://svnweb.freebsd.org/changeset/base/343430

Log:
  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
  MFC after:	3 days
  Sponsored by:	Netflix

Modified:
  head/sys/net/iflib.c

Modified: head/sys/net/iflib.c
==============================================================================
--- head/sys/net/iflib.c	Fri Jan 25 14:46:13 2019	(r343429)
+++ head/sys/net/iflib.c	Fri Jan 25 15:02:18 2019	(r343430)
@@ -2197,17 +2197,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?201901251502.x0PF2JJv030166>