Skip to content

Commit

Permalink
Fix coverity defects: CID 186143
Browse files Browse the repository at this point in the history
CID 186143: Memory - illegal accesses (USE_AFTER_FREE)

This patch fixes an use-after-free in spa_import_progress_destroy()
moving the kmem_free() call at the end of the function.

Signed-off-by: loli10K <ezomori.nozomu@gmail.com>
  • Loading branch information
loli10K committed May 17, 2019
1 parent f378f42 commit 8f7c739
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion module/zfs/spa_misc.c
Expand Up @@ -2102,8 +2102,8 @@ spa_import_progress_destroy(void)
spa_history_list_t *shl = spa_import_progress_list;
procfs_list_uninstall(&shl->procfs_list);
spa_import_progress_truncate(shl, 0);
kmem_free(shl, sizeof (spa_history_list_t));
procfs_list_destroy(&shl->procfs_list);
kmem_free(shl, sizeof (spa_history_list_t));
}

int
Expand Down

0 comments on commit 8f7c739

Please sign in to comment.