Free all allocated unit IDs in cuse(3) after the client character

devices have been destroyed to avoid creating character devices with
identical name.

MFC after:	1 week
Sponsored by:	Mellanox Technologies
This commit is contained in:
Hans Petter Selasky 2019-06-25 11:46:01 +00:00
parent c7ffaed92e
commit 43a9329e1b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=349368

View File

@ -671,8 +671,6 @@ cuse_server_unref(struct cuse_server *pcs)
TAILQ_REMOVE(&cuse_server_head, pcs, entry);
cuse_free_unit_by_id_locked(pcs, -1);
while ((pcsd = TAILQ_FIRST(&pcs->hdev)) != NULL) {
TAILQ_REMOVE(&pcs->hdev, pcsd, entry);
cuse_unlock();
@ -680,6 +678,8 @@ cuse_server_unref(struct cuse_server *pcs)
cuse_lock();
}
cuse_free_unit_by_id_locked(pcs, -1);
while ((mem = TAILQ_FIRST(&pcs->hmem)) != NULL) {
TAILQ_REMOVE(&pcs->hmem, mem, entry);
cuse_unlock();