summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
authorJonathan Adams <Jonathan.Adams@Sun.COM>2009-09-22 13:42:10 -0700
committerJonathan Adams <Jonathan.Adams@Sun.COM>2009-09-22 13:42:10 -0700
commit57f8140f6a54fd2ffd46f34a9d2c36071a5ac58e (patch)
treebc6d1be110e35e9806cf641c8e9fd86c7792dd02 /usr/src
parent674cb4b09c0706bc1cb658e79f39997d43bad8a0 (diff)
downloadillumos-gate-57f8140f6a54fd2ffd46f34a9d2c36071a5ac58e.tar.gz
6766866 mdb drops core when running ::whatis
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/cmd/mdb/common/modules/genunix/combined.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/usr/src/cmd/mdb/common/modules/genunix/combined.c b/usr/src/cmd/mdb/common/modules/genunix/combined.c
index be529ae40a..48bb3d96fa 100644
--- a/usr/src/cmd/mdb/common/modules/genunix/combined.c
+++ b/usr/src/cmd/mdb/common/modules/genunix/combined.c
@@ -19,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -187,11 +187,9 @@ combined_walk_step(mdb_walk_state_t *wsp)
wsp->walk_addr = cwd->cwd_initial_walk_addr;
status = cw->cw_init(wsp);
cw->cw_data = wsp->walk_data;
+ if (status != WALK_NEXT)
+ goto done;
cw->cw_initialized = B_TRUE;
- if (status != WALK_NEXT) {
- wsp->walk_data = cwd;
- return (status);
- }
}
/* save cwd for fini() in case step() is interrupted */
@@ -200,15 +198,19 @@ combined_walk_step(mdb_walk_state_t *wsp)
/* control may never reach here */
combined_walk_data_drop(cwd);
- if (status == WALK_DONE) {
- (void) combined_walk_remove_current(cwd);
- cw->cw_fini(wsp);
- mdb_free(cw, sizeof (combined_walk_t));
- wsp->walk_data = cwd;
- return (combined_walk_step(wsp));
- }
+ if (status == WALK_DONE)
+ goto done;
+ wsp->walk_data = cwd;
+ return (status);
+done:
+ (void) combined_walk_remove_current(cwd);
+ if (cw->cw_initialized)
+ cw->cw_fini(wsp);
+ mdb_free(cw, sizeof (combined_walk_t));
wsp->walk_data = cwd;
+ if (status == WALK_DONE)
+ return (combined_walk_step(wsp));
return (status);
}