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;
        }
 
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to