kernel: check object refcount before performing a recursive deletion
This commit is contained in:
@@ -110,7 +110,16 @@ static void object_cleanup(struct object *obj, unsigned long flags)
|
|||||||
struct queue_entry *entry = queue_pop_front(&queue);
|
struct queue_entry *entry = queue_pop_front(&queue);
|
||||||
struct object *child = NULL;
|
struct object *child = NULL;
|
||||||
obj->ob_type->ob_ops.destroy_recurse(entry, &child);
|
obj->ob_type->ob_ops.destroy_recurse(entry, &child);
|
||||||
if (child) {
|
if (!child) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (child->ob_refcount > 1) {
|
||||||
|
child->ob_refcount--;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (child->ob_refcount == 0 && child->ob_handles == 0) {
|
||||||
__cleanup(child, &queue);
|
__cleanup(child, &queue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user