Bug 264653 - IB/mlx5: Fix memory leak in clean_mr error path
Summary: IB/mlx5: Fix memory leak in clean_mr error path
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: Unspecified
Hardware: Any Any
: --- Affects Only Me
Assignee: Hans Petter Selasky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-06-13 06:37 UTC by xiaohuizhang
Modified: 2022-06-20 11:13 UTC (History)
3 users (show)

See Also:


Attachments
a possible patch (1.11 KB, patch)
2022-06-13 06:37 UTC, xiaohuizhang
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description xiaohuizhang 2022-06-13 06:37:04 UTC
Created attachment 234660 [details]
a possible patch

In clean_mr error path the 'mr' should be freed.
Comment 1 commit-hook freebsd_committer freebsd_triage 2022-06-13 15:07:24 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=e4d178d093281419c5ad9dea1c497bceb54d0018

commit e4d178d093281419c5ad9dea1c497bceb54d0018
Author:     Hans Petter Selasky <hselasky@FreeBSD.org>
AuthorDate: 2022-06-13 14:46:47 +0000
Commit:     Hans Petter Selasky <hselasky@FreeBSD.org>
CommitDate: 2022-06-13 15:00:16 +0000

    mlx5ib: Fix memory leak in clean_mr() error path

    In the clean_mr() error path the 'mr' should be freed.

    Linux commit:
    5942d8ae411775b76e5e1ab0cce57b0666516f2d

    PR:             264653
    MFC after:      1 week
    Sponsored by:   NVIDIA Networking

 sys/dev/mlx5/mlx5_ib/mlx5_ib_mr.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
Comment 2 Hans Petter Selasky freebsd_committer freebsd_triage 2022-06-13 15:07:58 UTC
Thank you for the submission!
Comment 3 commit-hook freebsd_committer freebsd_triage 2022-06-20 11:13:07 UTC
A commit in branch stable/13 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=492f5e649493fa7ae3a4ff4df886ba4312ffa8db

commit 492f5e649493fa7ae3a4ff4df886ba4312ffa8db
Author:     Hans Petter Selasky <hselasky@FreeBSD.org>
AuthorDate: 2022-06-13 14:46:47 +0000
Commit:     Hans Petter Selasky <hselasky@FreeBSD.org>
CommitDate: 2022-06-20 11:08:39 +0000

    mlx5ib: Fix memory leak in clean_mr() error path

    In the clean_mr() error path the 'mr' should be freed.

    Linux commit:
    5942d8ae411775b76e5e1ab0cce57b0666516f2d

    PR:             264653
    Sponsored by:   NVIDIA Networking

    (cherry picked from commit e4d178d093281419c5ad9dea1c497bceb54d0018)

 sys/dev/mlx5/mlx5_ib/mlx5_ib_mr.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)