Kick ctl clients when device is closed

This commit is contained in:
Alexandre Ratchov 2019-08-30 15:06:38 +02:00
parent f73fd84ddf
commit e15f9cc366
1 changed files with 7 additions and 0 deletions

View File

@ -1174,6 +1174,7 @@ dev_exitall(struct dev *d)
{
int i;
struct slot *s;
struct ctlslot *c;
for (s = d->slot, i = DEV_NSLOT; i > 0; i--, s++) {
if (s->ops)
@ -1181,6 +1182,12 @@ dev_exitall(struct dev *d)
s->ops = NULL;
}
d->slot_list = NULL;
for (c = d->ctlslot, i = DEV_NCTLSLOT; i > 0; i--, c++) {
if (c->ops)
c->ops->exit(c->arg);
c->ops = NULL;
}
}
/*