diff options
author | Poul-Henning Kamp <phk@FreeBSD.org> | 2005-08-20 12:13:51 +0000 |
---|---|---|
committer | Poul-Henning Kamp <phk@FreeBSD.org> | 2005-08-20 12:13:51 +0000 |
commit | 1d45c50ec3bea3094308094daf1d74ed9724ab1d (patch) | |
tree | 2b91ecdf44003d6382884736e577d83591ca7ee8 | |
parent | efd9ac0dfcee3d47e5b32ab2dca75364fc63dc2a (diff) |
Properly un-giant-trick the cdevsw in fini_cdevsw()
Tripped over by: Huang wen hui <huang@gddsn.org.cn>
Notes
Notes:
svn path=/head/; revision=149324
-rw-r--r-- | sys/kern/kern_conf.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/kern/kern_conf.c b/sys/kern/kern_conf.c index 8762352a0f9f..cf47c7c624b7 100644 --- a/sys/kern/kern_conf.c +++ b/sys/kern/kern_conf.c @@ -443,10 +443,14 @@ umajor(dev_t dev) static void fini_cdevsw(struct cdevsw *devsw) { + struct cdevsw *gt; - if (devsw->d_gianttrick != NULL) - free(devsw->d_gianttrick, M_DEVT); - devsw->d_gianttrick = NULL; + if (devsw->d_gianttrick != NULL) { + gt = devsw->d_gianttrick; + memcpy(devsw, gt, sizeof *devsw); + free(gt, M_DEVT); + devsw->d_gianttrick = NULL; + } devsw->d_flags &= ~D_INIT; } |