diff options
author | Pawel Jakub Dawidek <[email protected]> | 2023-05-06 00:51:41 +0900 |
---|---|---|
committer | GitHub <[email protected]> | 2023-05-05 08:51:41 -0700 |
commit | 599df8204962036c7b1039a8613c13bdb69c2e61 (patch) | |
tree | c36d1fa5033a4bd5eef0bd1dfde4dd87231aaec7 /module | |
parent | 82ac409acc77935ae366b800ee7cefb14939bbae (diff) |
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 <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Pawel Jakub Dawidek <[email protected]>
Closes #14824
Diffstat (limited to 'module')
-rw-r--r-- | module/zfs/zfs_ioctl.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/module/zfs/zfs_ioctl.c b/module/zfs/zfs_ioctl.c index 22e644f75..3b1e2ae5f 100644 --- a/module/zfs/zfs_ioctl.c +++ b/module/zfs/zfs_ioctl.c @@ -7862,6 +7862,8 @@ zfs_kmod_fini(void) zfs_onexit_destroy(zs->zs_onexit); if (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 */ |