mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-26 03:09:34 +03:00
Fix traverse_impl() kmem leak
The error path must free the memory allocated by this function or it will be leaked. In practice, this would leak only a few bytes of memory under rare circumstances and thus is unlikely to have caused any real problems. This issue was caught by the kmemleak. Reviewed-by: Giuseppe Di Natale <guss80@gmail.com> Reviewed-by: George Melikov <mail@gmelikov.ru> Reviewed-by: Chunwei Chen <tuxoko@gmail.com> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #7791
This commit is contained in:
parent
1dfde3d9b2
commit
4338c5c06f
@ -650,7 +650,7 @@ traverse_impl(spa_t *spa, dsl_dataset_t *ds, uint64_t objset, blkptr_t *rootbp,
|
||||
*/
|
||||
if (!(td->td_flags & TRAVERSE_HARD) ||
|
||||
!(td->td_flags & TRAVERSE_PRE))
|
||||
return (err);
|
||||
goto out;
|
||||
} else {
|
||||
osp = buf->b_data;
|
||||
traverse_zil(td, &osp->os_zil_header);
|
||||
@ -671,7 +671,7 @@ traverse_impl(spa_t *spa, dsl_dataset_t *ds, uint64_t objset, blkptr_t *rootbp,
|
||||
while (!pd->pd_exited)
|
||||
cv_wait_sig(&pd->pd_cv, &pd->pd_mtx);
|
||||
mutex_exit(&pd->pd_mtx);
|
||||
|
||||
out:
|
||||
mutex_destroy(&pd->pd_mtx);
|
||||
cv_destroy(&pd->pd_cv);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user