mirror of https://github.com/ericonr/sndio.git
sndiod: Fix use-after-free causing crash when devices is disconnected
This commit is contained in:
parent
e5766cbfc0
commit
a6a6dcb57c
|
@ -1290,12 +1290,12 @@ dev_abort(struct dev *d)
|
|||
d->slot_list = NULL;
|
||||
|
||||
for (c = ctlslot_array, i = DEV_NCTLSLOT; i > 0; i--, c++) {
|
||||
if (c->ops == NULL)
|
||||
continue;
|
||||
if (c->opt->dev != d)
|
||||
continue;
|
||||
if (c->ops) {
|
||||
c->ops->exit(c->arg);
|
||||
c->ops = NULL;
|
||||
}
|
||||
c->ops->exit(c->arg);
|
||||
c->ops = NULL;
|
||||
}
|
||||
|
||||
midi_abort(d->midi);
|
||||
|
|
Loading…
Reference in New Issue