Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 20 Jan 2018 01:55:34 +0000 (UTC)
From:      "Landon J. Fuller" <landonf@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r328187 - head/sys/dev/bhnd/cores/chipc
Message-ID:  <201801200155.w0K1tYen034704@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: landonf
Date: Sat Jan 20 01:55:34 2018
New Revision: 328187
URL: https://svnweb.freebsd.org/changeset/base/328187

Log:
  bhnd_chipc(4): Fix leak of child device ivars by explicitly deleting
  any children prior to detach.
  
  With the newbus child deletion ordering changes introduced in r307518,
  parent devices are now detached (and their driver set to NULL) prior to
  detaching and deleting child devices; child-related bus methods (e.g.
  BUS_CHILD_DETACHED, BUS_CHILD_DELETED) are no longer be dispatched to the
  parent device driver after it returns 0 (success) from DEVICE_DETACH.
  
  Sponsored by:   The FreeBSD Foundation

Modified:
  head/sys/dev/bhnd/cores/chipc/chipc.c

Modified: head/sys/dev/bhnd/cores/chipc/chipc.c
==============================================================================
--- head/sys/dev/bhnd/cores/chipc/chipc.c	Sat Jan 20 01:01:28 2018	(r328186)
+++ head/sys/dev/bhnd/cores/chipc/chipc.c	Sat Jan 20 01:55:34 2018	(r328187)
@@ -250,6 +250,9 @@ chipc_detach(device_t dev)
 	if ((error = bus_generic_detach(dev)))
 		return (error);
 
+	if ((error = device_delete_children(dev)))
+		return (error);
+
 	if ((error = bhnd_deregister_provider(dev, BHND_SERVICE_ANY)))
 		return (error);
 



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