Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 Jun 2011 13:12:56 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r222750 - head/sys/kern
Message-ID:  <201106061312.p56DCuqi032418@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Mon Jun  6 13:12:56 2011
New Revision: 222750
URL: http://svn.freebsd.org/changeset/base/222750

Log:
  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.
  
  PR:		kern/115371
  Submitted by:	Arthur Hartwig
  MFC after:	1 week

Modified:
  head/sys/kern/subr_rman.c

Modified: head/sys/kern/subr_rman.c
==============================================================================
--- head/sys/kern/subr_rman.c	Mon Jun  6 12:55:19 2011	(r222749)
+++ head/sys/kern/subr_rman.c	Mon Jun  6 13:12:56 2011	(r222750)
@@ -839,6 +839,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?201106061312.p56DCuqi032418>