From owner-svn-src-head@freebsd.org Sat Jan 20 01:55:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61ADCED5C0E; Sat, 20 Jan 2018 01:55:35 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3BE6F81F42; Sat, 20 Jan 2018 01:55:35 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 798F515B9C; Sat, 20 Jan 2018 01:55:34 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0K1tYds034705; Sat, 20 Jan 2018 01:55:34 GMT (envelope-from landonf@FreeBSD.org) Received: (from landonf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0K1tYen034704; Sat, 20 Jan 2018 01:55:34 GMT (envelope-from landonf@FreeBSD.org) Message-Id: <201801200155.w0K1tYen034704@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: landonf set sender to landonf@FreeBSD.org using -f From: "Landon J. Fuller" Date: Sat, 20 Jan 2018 01:55:34 +0000 (UTC) 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 X-SVN-Group: head X-SVN-Commit-Author: landonf X-SVN-Commit-Paths: head/sys/dev/bhnd/cores/chipc X-SVN-Commit-Revision: 328187 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jan 2018 01:55:35 -0000 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);