diff options
author | jhb <jhb@FreeBSD.org> | 2011-06-06 13:12:56 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2011-06-06 13:12:56 +0000 |
commit | aa8ddae28045296cfac5aae264a723e7b0664db7 (patch) | |
tree | 85a77dafa0374fd3c89d8bd92a72fdce0bb6591d | |
parent | 6e29aea1dbf128b84b885f9acc6396c69ab080ce (diff) | |
download | FreeBSD-src-aa8ddae28045296cfac5aae264a723e7b0664db7.zip FreeBSD-src-aa8ddae28045296cfac5aae264a723e7b0664db7.tar.gz |
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
-rw-r--r-- | sys/kern/subr_rman.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/kern/subr_rman.c b/sys/kern/subr_rman.c index 3014b19..abd72c0 100644 --- a/sys/kern/subr_rman.c +++ b/sys/kern/subr_rman.c @@ -839,6 +839,7 @@ int_rman_release_resource(struct rman *rm, struct resource_i *r) * without freeing anything. */ r->r_flags &= ~RF_ALLOCATED; + r->r_dev = NULL; return 0; } |