Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 14 Jun 2011 18:54:42 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r223093 - stable/7/sys/kern
Message-ID:  <201106141854.p5EIsgPK047400@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Tue Jun 14 18:54:42 2011
New Revision: 223093
URL: http://svn.freebsd.org/changeset/base/223093

Log:
  MFC 222750:
  Clear the device_t pointer in 'struct resource' when releasing a device
  as otherwise the sysctl to export rman info can dereference a stale
  pointer.

Modified:
  stable/7/sys/kern/subr_rman.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/kern/subr_rman.c
==============================================================================
--- stable/7/sys/kern/subr_rman.c	Tue Jun 14 18:54:31 2011	(r223092)
+++ stable/7/sys/kern/subr_rman.c	Tue Jun 14 18:54:42 2011	(r223093)
@@ -677,6 +677,7 @@ int_rman_release_resource(struct rman *r
 		 * without freeing anything.
 		 */
 		r->r_flags &= ~RF_ALLOCATED;
+		r->r_dev = NULL;
 		return 0;
 	}
 



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