svn commit: r328187 - head/sys/dev/bhnd/cores/chipc

Landon J. Fuller landonf at FreeBSD.org
Sat Jan 20 01:55:35 UTC 2018


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);
 


More information about the svn-src-head mailing list