Properly un-giant-trick the cdevsw in fini_cdevsw()
Tripped over by: Huang wen hui <huang@gddsn.org.cn>
This commit is contained in:
parent
efd9ac0dfc
commit
1d45c50ec3
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user