Plug memory leak in zfsdev_state.
On kernel module unload, free all zfsdev state structures, except for zfsdev_state_listhead, which is statically allocated. Reviewed-by: Richard Yao <richard.yao@alumni.stonybrook.edu> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Pawel Jakub Dawidek <pawel@dawidek.net> Closes #14824
This commit is contained in:
parent
82ac409acc
commit
599df82049
|
@ -7862,6 +7862,8 @@ zfs_kmod_fini(void)
|
||||||
zfs_onexit_destroy(zs->zs_onexit);
|
zfs_onexit_destroy(zs->zs_onexit);
|
||||||
if (zs->zs_zevent)
|
if (zs->zs_zevent)
|
||||||
zfs_zevent_destroy(zs->zs_zevent);
|
zfs_zevent_destroy(zs->zs_zevent);
|
||||||
|
if (zs != &zfsdev_state_listhead)
|
||||||
|
kmem_free(zs, sizeof (zfsdev_state_t));
|
||||||
}
|
}
|
||||||
|
|
||||||
zfs_ereport_taskq_fini(); /* run before zfs_fini() on Linux */
|
zfs_ereport_taskq_fini(); /* run before zfs_fini() on Linux */
|
||||||
|
|
Loading…
Reference in New Issue