mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-10-28 11:25:21 +01:00
dmu_objset_open_impl: unregister prop callbacks on error
If dsl_prop_register() fails partway, the error path frees the objset without removing the callbacks already registered, leaving records that point at freed memory. Call dsl_prop_unregister_all() first. Reviewed-by: Tony Hutter <[email protected]> Reviewed-by: Alexander Motin <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Martin Minkus <[email protected]> Closes #18903
This commit is contained in:
1 parent
8aa9d7795a
commit
904d4327f4
1 file changed
+1
@@ -628,6 +628,7 @@ dmu_objset_open_impl(spa_t *spa, dsl_dataset_t *ds, blkptr_t *bp,
|
||||
}
|
||||
}
|
||||
if (err != 0) {
|
||||
dsl_prop_unregister_all(ds, os);
|
||||
arc_buf_destroy(os->os_phys_buf, &os->os_phys_buf);
|
||||
kmem_free(os, sizeof (objset_t));
|
||||
return (err);
|
||||
|
||||
Reference in new issue
Block a user