]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
vdpa/mlx5: Don't clear mr struct on destroy MR
authorEli Cohen <elic@nvidia.com>
Mon, 6 Feb 2023 12:19:56 +0000 (14:19 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 1 Mar 2024 12:21:51 +0000 (13:21 +0100)
[ Upstream commit aef24311bd2d8a6d39a80c34f278b0fd1692aed3 ]

Clearing the mr struct erases the lock owner and causes warnings to be
emitted. It is not required to clear the mr so remove the memset call.

Fixes: 94abbccdf291 ("vdpa/mlx5: Add shared memory registration code")
Signed-off-by: Eli Cohen <elic@nvidia.com>
Message-Id: <20230206121956.1149356-1-elic@nvidia.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/vdpa/mlx5/core/mr.c

index ff010c6d0cd39e78e9e688ad398102ab18048bd2..bdc7595fcb0e3aafb63c1638f1b91022b1619a26 100644 (file)
@@ -505,7 +505,6 @@ void mlx5_vdpa_destroy_mr(struct mlx5_vdpa_dev *mvdev)
        else
                destroy_dma_mr(mvdev, mr);
 
-       memset(mr, 0, sizeof(*mr));
        mr->initialized = false;
 out:
        mutex_unlock(&mr->mkey_mtx);