Created attachment 234222 [details] a possible patch Before kfree(fs_rule), fs_rule->mirr_mbox should be released since it is an allocated data.
Have you checked if a fix exist in Linux?
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=f29c9901a41fb650d46fd48f4880a894f54aa737 commit f29c9901a41fb650d46fd48f4880a894f54aa737 Author: Hans Petter Selasky <hselasky@FreeBSD.org> AuthorDate: 2022-05-30 18:11:50 +0000 Commit: Hans Petter Selasky <hselasky@FreeBSD.org> CommitDate: 2022-05-30 18:22:18 +0000 mlx4core: Fix a memory leak when deleting slave's resources mlx4_delete_all_resources_for_slave() in the resource tracker should free all memory allocated for a slave. While releasing memory of fs_rule, it misses releasing memory of fs_rule->mirr_mbox. Linux commit: 461d5f1b59490ce0096dfda45e10038c122a7892 PR: 264249 MFC after: 1 week Sponsored by: NVIDIA Networking sys/dev/mlx4/mlx4_core/mlx4_resource_tracker.c | 1 + 1 file changed, 1 insertion(+)
Thank you! --HPS
A commit in branch stable/13 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=d264494e983ac964dc5cb8a2e51cddbb9d6c3631 commit d264494e983ac964dc5cb8a2e51cddbb9d6c3631 Author: Hans Petter Selasky <hselasky@FreeBSD.org> AuthorDate: 2022-05-30 18:11:50 +0000 Commit: Hans Petter Selasky <hselasky@FreeBSD.org> CommitDate: 2022-06-07 06:44:29 +0000 mlx4core: Fix a memory leak when deleting slave's resources mlx4_delete_all_resources_for_slave() in the resource tracker should free all memory allocated for a slave. While releasing memory of fs_rule, it misses releasing memory of fs_rule->mirr_mbox. Linux commit: 461d5f1b59490ce0096dfda45e10038c122a7892 PR: 264249 Sponsored by: NVIDIA Networking (cherry picked from commit f29c9901a41fb650d46fd48f4880a894f54aa737) sys/dev/mlx4/mlx4_core/mlx4_resource_tracker.c | 1 + 1 file changed, 1 insertion(+)
A commit in branch stable/12 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=e8215345313aa9ac7aca6cbe0851fa452088a784 commit e8215345313aa9ac7aca6cbe0851fa452088a784 Author: Hans Petter Selasky <hselasky@FreeBSD.org> AuthorDate: 2022-05-30 18:11:50 +0000 Commit: Hans Petter Selasky <hselasky@FreeBSD.org> CommitDate: 2022-06-07 06:46:18 +0000 mlx4core: Fix a memory leak when deleting slave's resources mlx4_delete_all_resources_for_slave() in the resource tracker should free all memory allocated for a slave. While releasing memory of fs_rule, it misses releasing memory of fs_rule->mirr_mbox. Linux commit: 461d5f1b59490ce0096dfda45e10038c122a7892 PR: 264249 Sponsored by: NVIDIA Networking (cherry picked from commit f29c9901a41fb650d46fd48f4880a894f54aa737) sys/dev/mlx4/mlx4_core/mlx4_resource_tracker.c | 1 + 1 file changed, 1 insertion(+)